From owner-xfs@oss.sgi.com Wed Jan 2 05:16:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jan 2008 05:16:28 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m02DGLIV005036 for ; Wed, 2 Jan 2008 05:16:24 -0800 X-ASG-Debug-ID: 1199279794-27d800000000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from welcomes-you.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2849A12250B1 for ; Wed, 2 Jan 2008 05:16:34 -0800 (PST) Received: from welcomes-you.com (welcomes-you.com [85.214.50.128]) by cuda.sgi.com with ESMTP id Gt2BSU2YCeKFdkDy for ; Wed, 02 Jan 2008 05:16:34 -0800 (PST) Received: from [130.75.117.49] (helo=[10.117.96.105]) by welcomes-you.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.62) (envelope-from ) id 1JA3SO-0007w5-HC; Wed, 02 Jan 2008 14:16:31 +0100 Message-ID: <477B8EAB.8000703@welcomes-you.com> Date: Wed, 02 Jan 2008 14:16:27 +0100 From: Carsten Aulbert User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8pre) Gecko/20071022 Thunderbird/2.0.0.6 Mnenhy/0.7.5.666 MIME-Version: 1.0 To: xfs@oss.sgi.com X-Enigmail-Version: 0.95.5 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-ASG-Orig-Subj: How to damage a XFS-Filesystem? Subject: How to damage a XFS-Filesystem? X-SA-Exim-Version: 4.2.1 (built Tue, 20 Jun 2006 01:09:49 +0000) X-Barracuda-Connect: welcomes-you.com[85.214.50.128] X-Barracuda-Start-Time: 1199279797 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38365 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5339/Wed Jan 2 02:52:11 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14071 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: carsten@welcomes-you.com Precedence: bulk X-list: xfs Hi, I have the following scenario: A file server with a 10 TB large xfs file system running on a RAID6 SATA array, the server has 16 GB of memory. I want to test how long it would take to run xfs_repair on it and if the amount of memory is enough for that. Thus I think I would need to: (1) Fill the disk with files (2) Damage the file sytem (3) Run xfs_repair My questions: (1) Is there a nice tool which fills up a disk? I.e. I want to write files with varying size and want to be able to check the validity (md5,sha1...) of the files before and after the damage. I don't know if it matters, but the number of entries per directory should also vary greatly ;) (2) I don't know if xfs_repair cares if the file system was damaged or not. If it uses the same amount of time and memory on a fully intact file system, I guess I don't have a question anymore. Otherwise: How can a damage a xfs file system to make the job harder for xfs_repair. I guess a simple dd if=/dev/random of=/dev/sdb1 with some offsets will not be very effective, right? (3) Anything else I need to be aware of? Thanks for your patience (and yes, I have tried the archives for answers) Cheers Carsten From owner-xfs@oss.sgi.com Wed Jan 2 09:47:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jan 2008 09:47:57 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m02HlnEc030673 for ; Wed, 2 Jan 2008 09:47:52 -0800 X-ASG-Debug-ID: 1199296085-27d8025f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp117.sbc.mail.sp1.yahoo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 93B0B1226F2E for ; Wed, 2 Jan 2008 09:48:05 -0800 (PST) Received: from smtp117.sbc.mail.sp1.yahoo.com (smtp117.sbc.mail.sp1.yahoo.com [69.147.64.90]) by cuda.sgi.com with SMTP id XU2xxIODbJ2xMKEC for ; Wed, 02 Jan 2008 09:48:05 -0800 (PST) Received: (qmail 47676 invoked from network); 2 Jan 2008 17:48:05 -0000 Received: from unknown (HELO stupidest.org) (cwedgwood@sbcglobal.net@24.5.75.45 with login) by smtp117.sbc.mail.sp1.yahoo.com with SMTP; 2 Jan 2008 17:48:04 -0000 X-YMail-OSG: zmIVVaUVM1mnW9heZzeeaqwl..vMiZ2p.mvrrHn8nZ9UedFT Received: by tuatara.stupidest.org (Postfix, from userid 10000) id C73C4282F2B9; Wed, 2 Jan 2008 09:48:05 -0800 (PST) Date: Wed, 2 Jan 2008 09:48:05 -0800 From: Chris Wedgwood To: Carsten Aulbert Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: How to damage a XFS-Filesystem? Subject: Re: How to damage a XFS-Filesystem? Message-ID: <20080102174805.GA32592@puku.stupidest.org> References: <477B8EAB.8000703@welcomes-you.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <477B8EAB.8000703@welcomes-you.com> X-Barracuda-Connect: smtp117.sbc.mail.sp1.yahoo.com[69.147.64.90] X-Barracuda-Start-Time: 1199296085 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38382 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5342/Wed Jan 2 08:47:10 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14072 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: cw@f00f.org Precedence: bulk X-list: xfs On Wed, Jan 02, 2008 at 02:16:27PM +0100, Carsten Aulbert wrote: > A file server with a 10 TB large xfs file system running on a RAID6 > SATA array, the server has 16 GB of memory. I want to test how long > it would take to run xfs_repair on it and if the amount of memory is > enough for that. It depends on how fast the IO is and also how many files there are. If you have a small number of really large files it's fairly fast, if you have a large number of really small files (ie. email maildir) then it tends to be much slower. > (2) Damage the file sytem > (3) Run xfs_repair xfs_repair will run without having to damage the filesystem (though if/when damaged it will probably be a little slower). > Otherwise: How can a damage a xfs file system to make the job harder > for xfs_repair. Google for fsfuzzer. > I guess a simple dd if=/dev/random of=/dev/sdb1 with some offsets > will not be very effective, right? If it misses the metadata, xfs_repair won't even notice. If you whack large chunks of metadata you might see considerable data loss. From owner-xfs@oss.sgi.com Wed Jan 2 13:39:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jan 2008 13:39:35 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m02LdQW9020247 for ; Wed, 2 Jan 2008 13:39:29 -0800 X-ASG-Debug-ID: 1199309973-3a8e00bb0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 82E904DA139 for ; Wed, 2 Jan 2008 13:39:34 -0800 (PST) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id MZJ42rTGcc7wrkSF for ; Wed, 02 Jan 2008 13:39:34 -0800 (PST) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m02LVeF3005341 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 2 Jan 2008 22:31:40 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m02LVe9i005339 for xfs@oss.sgi.com; Wed, 2 Jan 2008 22:31:40 +0100 Date: Wed, 2 Jan 2008 22:31:40 +0100 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] cleanup xfs_vn_mknod Subject: [PATCH] cleanup xfs_vn_mknod Message-ID: <20080102213140.GA5204@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1199309981 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38397 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5343/Wed Jan 2 09:41:01 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14073 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 - use proper goto based unwinding instead of the current mess of multiple conditionals - rename ip to inode because that's the normal convention for Linux inodes while ip is the convention for xfs_inodes - remove unlikely checks for the default_acl - branches marked unlikely might lead to extreme branch bredictor slowdons if taken and for some workloads a default acl is quite common - properly indent the switch statements - remove xfs_has_fs_struct as nfsd has a fs_struct in any semi-recent kernel Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2007-12-21 07:25:06.000000000 +0100 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2007-12-21 07:33:25.000000000 +0100 @@ -241,18 +241,6 @@ xfs_init_security( return error; } -/* - * Determine whether a process has a valid fs_struct (kernel daemons - * like knfsd don't have an fs_struct). - * - * XXX(hch): nfsd is broken, better fix it instead. - */ -STATIC_INLINE int -xfs_has_fs_struct(struct task_struct *task) -{ - return (task->fs != init_task.fs); -} - STATIC void xfs_cleanup_inode( struct inode *dir, @@ -284,7 +272,7 @@ xfs_vn_mknod( int mode, dev_t rdev) { - struct inode *ip; + struct inode *inode; bhv_vnode_t *vp = NULL, *dvp = vn_from_inode(dir); xfs_acl_t *default_acl = NULL; attrexists_t test_default_acl = _ACL_DEFAULT_EXISTS; @@ -297,7 +285,7 @@ xfs_vn_mknod( if (unlikely(!sysv_valid_dev(rdev) || MAJOR(rdev) & ~0x1ff)) return -EINVAL; - if (unlikely(test_default_acl && test_default_acl(dvp))) { + if (test_default_acl && test_default_acl(dvp)) { if (!_ACL_ALLOC(default_acl)) { return -ENOMEM; } @@ -307,11 +295,14 @@ xfs_vn_mknod( } } - if (IS_POSIXACL(dir) && !default_acl && xfs_has_fs_struct(current)) + if (IS_POSIXACL(dir) && !default_acl) mode &= ~current->fs->umask; switch (mode & S_IFMT) { - case S_IFCHR: case S_IFBLK: case S_IFIFO: case S_IFSOCK: + case S_IFCHR: + case S_IFBLK: + case S_IFIFO: + case S_IFSOCK: rdev = sysv_encode_dev(rdev); case S_IFREG: error = xfs_create(XFS_I(dir), dentry, mode, rdev, &vp, NULL); @@ -324,32 +315,34 @@ xfs_vn_mknod( break; } - if (unlikely(!error)) { - error = xfs_init_security(vp, dir); - if (error) - xfs_cleanup_inode(dir, vp, dentry, mode); - } + if (unlikely(error)) + goto out_free_acl; - if (unlikely(default_acl)) { - if (!error) { - error = _ACL_INHERIT(vp, mode, default_acl); - if (!error) - xfs_iflags_set(XFS_I(vp), XFS_IMODIFIED); - else - xfs_cleanup_inode(dir, vp, dentry, mode); - } + error = xfs_init_security(vp, dir); + if (unlikely(error)) + goto out_cleanup_inode; + + if (default_acl) { + error = _ACL_INHERIT(vp, mode, default_acl); + if (unlikely(error)) + goto out_cleanup_inode; + xfs_iflags_set(XFS_I(vp), XFS_IMODIFIED); _ACL_FREE(default_acl); } - if (likely(!error)) { - ASSERT(vp); - ip = vn_to_inode(vp); + inode = vn_to_inode(vp); - if (S_ISDIR(mode)) - xfs_validate_fields(ip); - d_instantiate(dentry, ip); - xfs_validate_fields(dir); - } + if (S_ISDIR(mode)) + xfs_validate_fields(inode); + d_instantiate(dentry, inode); + xfs_validate_fields(dir); + return -error; + + out_cleanup_inode: + xfs_cleanup_inode(dir, vp, dentry, mode); + out_free_acl: + if (default_acl) + _ACL_FREE(default_acl); return -error; } From owner-xfs@oss.sgi.com Thu Jan 3 04:49:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jan 2008 04:49:54 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m03CnhoC016449 for ; Thu, 3 Jan 2008 04:49:48 -0800 X-ASG-Debug-ID: 1199364595-4faf00360000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6CE1D4DD23D for ; Thu, 3 Jan 2008 04:49:55 -0800 (PST) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 7djmb188imasBatK for ; Thu, 03 Jan 2008 04:49:55 -0800 (PST) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m03CnnF3005399 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 3 Jan 2008 13:49:49 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m03CnnIh005395 for xfs@oss.sgi.com; Thu, 3 Jan 2008 13:49:49 +0100 Date: Thu, 3 Jan 2008 13:49:49 +0100 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] vnode cleanup in xfs_fs_subr.c Subject: [PATCH] vnode cleanup in xfs_fs_subr.c Message-ID: <20080103124949.GA5331@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1199364599 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38459 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5348/Wed Jan 2 21:26:56 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14074 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 Cleanup the unneeded intermediate vnode step in the flushing helpers and go directly from the xfs_inode to the struct address_space. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_fs_subr.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_fs_subr.c 2007-09-23 14:09:19.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_fs_subr.c 2007-09-23 14:11:55.000000000 +0200 @@ -17,18 +17,7 @@ */ #include "xfs.h" #include "xfs_vnodeops.h" - -/* - * The following six includes are needed so that we can include - * xfs_inode.h. What a mess.. - */ #include "xfs_bmap_btree.h" -#include "xfs_inum.h" -#include "xfs_dir2.h" -#include "xfs_dir2_sf.h" -#include "xfs_attr_sf.h" -#include "xfs_dinode.h" - #include "xfs_inode.h" int fs_noerr(void) { return 0; } @@ -42,11 +31,10 @@ xfs_tosspages( xfs_off_t last, int fiopt) { - bhv_vnode_t *vp = XFS_ITOV(ip); - struct inode *inode = vn_to_inode(vp); + struct address_space *mapping = ip->i_vnode->i_mapping; - if (VN_CACHED(vp)) - truncate_inode_pages(inode->i_mapping, first); + if (mapping->nrpages) + truncate_inode_pages(mapping, first); } int @@ -56,15 +44,14 @@ xfs_flushinval_pages( xfs_off_t last, int fiopt) { - bhv_vnode_t *vp = XFS_ITOV(ip); - struct inode *inode = vn_to_inode(vp); + struct address_space *mapping = ip->i_vnode->i_mapping; int ret = 0; - if (VN_CACHED(vp)) { + if (mapping->nrpages) { xfs_iflags_clear(ip, XFS_ITRUNCATED); - ret = filemap_write_and_wait(inode->i_mapping); + ret = filemap_write_and_wait(mapping); if (!ret) - truncate_inode_pages(inode->i_mapping, first); + truncate_inode_pages(mapping, first); } return ret; } @@ -77,17 +64,16 @@ xfs_flush_pages( uint64_t flags, int fiopt) { - bhv_vnode_t *vp = XFS_ITOV(ip); - struct inode *inode = vn_to_inode(vp); + struct address_space *mapping = ip->i_vnode->i_mapping; int ret = 0; int ret2; - if (VN_DIRTY(vp)) { + if (mapping_tagged(mapping, PAGECACHE_TAG_DIRTY)) { xfs_iflags_clear(ip, XFS_ITRUNCATED); - ret = filemap_fdatawrite(inode->i_mapping); + ret = filemap_fdatawrite(mapping); if (flags & XFS_B_ASYNC) return ret; - ret2 = filemap_fdatawait(inode->i_mapping); + ret2 = filemap_fdatawait(mapping); if (!ret) ret = ret2; } From owner-xfs@oss.sgi.com Thu Jan 3 04:56:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jan 2008 04:56:43 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m03CubX9017257 for ; Thu, 3 Jan 2008 04:56:39 -0800 X-ASG-Debug-ID: 1199365007-725302d20000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 498DB11868E5 for ; Thu, 3 Jan 2008 04:56:47 -0800 (PST) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id WzKwZz168Xb1JLdt for ; Thu, 03 Jan 2008 04:56:47 -0800 (PST) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m03CufF3005737 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 3 Jan 2008 13:56:41 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m03CufED005735 for xfs@oss.sgi.com; Thu, 3 Jan 2008 13:56:41 +0100 Date: Thu, 3 Jan 2008 13:56:41 +0100 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] kill xfs_rwlock/xfs_rwunlock Subject: [PATCH] kill xfs_rwlock/xfs_rwunlock Message-ID: <20080103125641.GC5331@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1199365012 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38458 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5348/Wed Jan 2 21:26:56 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14075 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs We can just use xfs_ilock/xfs_iunlock instead and get rid of the ugly bhv_vrwlock_t. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c 2007-12-26 16:57:48.000000000 +0100 +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2007-12-26 17:02:32.000000000 +0100 @@ -138,7 +138,7 @@ xfs_dm_send_data_event( xfs_off_t offset, size_t length, int flags, - bhv_vrwlock_t *locktype) + int *lock_flags) { int error; xfs_inode_t *ip; @@ -150,8 +150,8 @@ xfs_dm_send_data_event( ip = xfs_vtoi(vp); do { dmstate = ip->i_d.di_dmstate; - if (locktype) - xfs_rwunlock(ip, *locktype); + if (lock_flags) + xfs_iunlock(ip, *lock_flags); up_rw_sems(inode, flags); @@ -161,8 +161,8 @@ xfs_dm_send_data_event( down_rw_sems(inode, flags); - if (locktype) - xfs_rwlock(ip, *locktype); + if (lock_flags) + xfs_ilock(ip, *lock_flags); } while (!error && (ip->i_d.di_dmstate != dmstate)); return error; @@ -3085,7 +3085,6 @@ xfs_dm_send_mmap_event( xfs_inode_t *ip; int error = 0; dm_eventtype_t max_event = DM_EVENT_READ; - bhv_vrwlock_t locktype; xfs_fsize_t filesize; xfs_off_t length, end_of_area, evsize, offset; int iolock; @@ -3140,20 +3139,16 @@ xfs_dm_send_mmap_event( if (evsize < 0) evsize = 0; - if (max_event == DM_EVENT_READ) { - locktype = VRWLOCK_READ; + if (max_event == DM_EVENT_READ) iolock = XFS_IOLOCK_SHARED; - } - else { - locktype = VRWLOCK_WRITE; + else iolock = XFS_IOLOCK_EXCL; - } xfs_ilock(ip, iolock); /* If write possible, try a DMAPI write event */ if (max_event == DM_EVENT_WRITE && DM_EVENT_ENABLED(ip, max_event)) { error = xfs_dm_send_data_event(max_event, vp, offset, - evsize, 0, &locktype); + evsize, 0, &iolock); goto out_unlock; } @@ -3162,7 +3157,7 @@ xfs_dm_send_mmap_event( */ if (DM_EVENT_ENABLED(ip, DM_EVENT_READ)) { error = xfs_dm_send_data_event(DM_EVENT_READ, vp, offset, - evsize, 0, &locktype); + evsize, 0, &iolock); } out_unlock: xfs_iunlock(ip, iolock); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_aops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_aops.c 2007-12-13 18:56:04.000000000 +0100 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_aops.c 2007-12-26 17:08:46.000000000 +0100 @@ -1532,9 +1532,9 @@ xfs_vm_bmap( struct xfs_inode *ip = XFS_I(inode); xfs_itrace_entry(XFS_I(inode)); - xfs_rwlock(ip, VRWLOCK_READ); + xfs_ilock(ip, XFS_IOLOCK_SHARED); xfs_flush_pages(ip, (xfs_off_t)0, -1, 0, FI_REMAPF); - xfs_rwunlock(ip, VRWLOCK_READ); + xfs_iunlock(ip, XFS_IOLOCK_SHARED); return generic_block_bmap(mapping, block, xfs_get_blocks); } Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2007-12-26 16:57:52.000000000 +0100 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2007-12-26 17:01:28.000000000 +0100 @@ -263,8 +263,6 @@ EXPORT_SYMBOL(xfs_mountfs); EXPORT_SYMBOL(xfs_qm_dqcheck); EXPORT_SYMBOL(xfs_readsb); EXPORT_SYMBOL(xfs_read_buf); -EXPORT_SYMBOL(xfs_rwlock); -EXPORT_SYMBOL(xfs_rwunlock); EXPORT_SYMBOL(xfs_setattr); EXPORT_SYMBOL(xfs_attr_get); EXPORT_SYMBOL(xfs_attr_set); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_lrw.c 2007-12-26 16:36:09.000000000 +0100 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c 2007-12-26 17:05:08.000000000 +0100 @@ -228,11 +228,11 @@ xfs_read( xfs_ilock(ip, XFS_IOLOCK_SHARED); if (DM_EVENT_ENABLED(ip, DM_EVENT_READ) && !(ioflags & IO_INVIS)) { - bhv_vrwlock_t locktype = VRWLOCK_READ; int dmflags = FILP_DELAY_FLAG(file) | DM_SEM_FLAG_RD(ioflags); + int iolock = XFS_IOLOCK_SHARED; ret = -XFS_SEND_DATA(mp, DM_EVENT_READ, vp, *offset, size, - dmflags, &locktype); + dmflags, &iolock); if (ret) { xfs_iunlock(ip, XFS_IOLOCK_SHARED); if (unlikely(ioflags & IO_ISDIRECT)) @@ -287,11 +287,11 @@ xfs_splice_read( xfs_ilock(ip, XFS_IOLOCK_SHARED); if (DM_EVENT_ENABLED(ip, DM_EVENT_READ) && !(ioflags & IO_INVIS)) { - bhv_vrwlock_t locktype = VRWLOCK_READ; + int iolock = XFS_IOLOCK_SHARED; int error; error = XFS_SEND_DATA(mp, DM_EVENT_READ, vp, *ppos, count, - FILP_DELAY_FLAG(infilp), &locktype); + FILP_DELAY_FLAG(infilp), &iolock); if (error) { xfs_iunlock(ip, XFS_IOLOCK_SHARED); return -error; @@ -330,11 +330,11 @@ xfs_splice_write( xfs_ilock(ip, XFS_IOLOCK_EXCL); if (DM_EVENT_ENABLED(ip, DM_EVENT_WRITE) && !(ioflags & IO_INVIS)) { - bhv_vrwlock_t locktype = VRWLOCK_WRITE; + int iolock = XFS_IOLOCK_EXCL; int error; error = XFS_SEND_DATA(mp, DM_EVENT_WRITE, vp, *ppos, count, - FILP_DELAY_FLAG(outfilp), &locktype); + FILP_DELAY_FLAG(outfilp), &iolock); if (error) { xfs_iunlock(ip, XFS_IOLOCK_EXCL); return -error; @@ -580,7 +580,6 @@ xfs_write( xfs_fsize_t isize, new_size; int iolock; int eventsent = 0; - bhv_vrwlock_t locktype; size_t ocount = 0, count; loff_t pos; int need_i_mutex; @@ -607,11 +606,9 @@ xfs_write( relock: if (ioflags & IO_ISDIRECT) { iolock = XFS_IOLOCK_SHARED; - locktype = VRWLOCK_WRITE_DIRECT; need_i_mutex = 0; } else { iolock = XFS_IOLOCK_EXCL; - locktype = VRWLOCK_WRITE; need_i_mutex = 1; mutex_lock(&inode->i_mutex); } @@ -635,8 +632,7 @@ start: xfs_iunlock(xip, XFS_ILOCK_EXCL); error = XFS_SEND_DATA(xip->i_mount, DM_EVENT_WRITE, vp, - pos, count, - dmflags, &locktype); + pos, count, dmflags, &iolock); if (error) { goto out_unlock_internal; } @@ -667,7 +663,6 @@ start: if (!need_i_mutex && (VN_CACHED(vp) || pos > xip->i_size)) { xfs_iunlock(xip, XFS_ILOCK_EXCL|iolock); iolock = XFS_IOLOCK_EXCL; - locktype = VRWLOCK_WRITE; need_i_mutex = 1; mutex_lock(&inode->i_mutex); xfs_ilock(xip, XFS_ILOCK_EXCL|iolock); @@ -744,7 +739,6 @@ retry: mutex_unlock(&inode->i_mutex); iolock = XFS_IOLOCK_SHARED; - locktype = VRWLOCK_WRITE_DIRECT; need_i_mutex = 0; } @@ -781,7 +775,7 @@ retry: if (ret == -ENOSPC && DM_EVENT_ENABLED(xip, DM_EVENT_NOSPACE) && !(ioflags & IO_INVIS)) { - xfs_rwunlock(xip, locktype); + xfs_iunlock(xip, iolock); if (need_i_mutex) mutex_unlock(&inode->i_mutex); error = XFS_SEND_NAMESP(xip->i_mount, DM_EVENT_NOSPACE, vp, @@ -789,7 +783,7 @@ retry: 0, 0, 0); /* Delay flag intentionally unused */ if (need_i_mutex) mutex_lock(&inode->i_mutex); - xfs_rwlock(xip, locktype); + xfs_ilock(xip, iolock); if (error) goto out_unlock_internal; pos = xip->i_size; @@ -817,7 +811,8 @@ retry: /* Handle various SYNC-type writes */ if ((file->f_flags & O_SYNC) || IS_SYNC(inode)) { int error2; - xfs_rwunlock(xip, locktype); + + xfs_iunlock(xip, iolock); if (need_i_mutex) mutex_unlock(&inode->i_mutex); error2 = sync_page_range(inode, mapping, pos, ret); @@ -825,7 +820,7 @@ retry: error = error2; if (need_i_mutex) mutex_lock(&inode->i_mutex); - xfs_rwlock(xip, locktype); + xfs_ilock(xip, iolock); error2 = xfs_write_sync_logforce(mp, xip); if (!error) error = error2; @@ -846,7 +841,7 @@ retry: xip->i_d.di_size = xip->i_size; xfs_iunlock(xip, XFS_ILOCK_EXCL); } - xfs_rwunlock(xip, locktype); + xfs_iunlock(xip, iolock); out_unlock_mutex: if (need_i_mutex) mutex_unlock(&inode->i_mutex); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2007-12-26 17:00:49.000000000 +0100 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2007-12-26 17:01:28.000000000 +0100 @@ -46,18 +46,6 @@ static inline struct inode *vn_to_inode( } /* - * Values for the vop_rwlock/rwunlock flags parameter. - */ -typedef enum bhv_vrwlock { - VRWLOCK_NONE, - VRWLOCK_READ, - VRWLOCK_WRITE, - VRWLOCK_WRITE_DIRECT, - VRWLOCK_TRY_READ, - VRWLOCK_TRY_WRITE -} bhv_vrwlock_t; - -/* * Return values for xfs_inactive. A return value of * VN_INACTIVE_NOCACHE implies that the file system behavior * has disassociated its state and bhv_desc_t from the vnode. Index: linux-2.6-xfs/fs/xfs/xfs_mount.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.h 2007-12-26 17:00:55.000000000 +0100 +++ linux-2.6-xfs/fs/xfs/xfs_mount.h 2007-12-26 17:01:28.000000000 +0100 @@ -67,7 +67,7 @@ struct xfs_mru_cache; */ typedef int (*xfs_send_data_t)(int, bhv_vnode_t *, - xfs_off_t, size_t, int, bhv_vrwlock_t *); + xfs_off_t, size_t, int, int *); typedef int (*xfs_send_mmap_t)(struct vm_area_struct *, uint); typedef int (*xfs_send_destroy_t)(bhv_vnode_t *, dm_right_t); typedef int (*xfs_send_namesp_t)(dm_eventtype_t, struct xfs_mount *, Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2007-12-26 17:00:49.000000000 +0100 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2007-12-26 17:03:55.000000000 +0100 @@ -3398,54 +3398,6 @@ std_return: } int -xfs_rwlock( - xfs_inode_t *ip, - bhv_vrwlock_t locktype) -{ - if (S_ISDIR(ip->i_d.di_mode)) - return 1; - if (locktype == VRWLOCK_WRITE) { - xfs_ilock(ip, XFS_IOLOCK_EXCL); - } else if (locktype == VRWLOCK_TRY_READ) { - return xfs_ilock_nowait(ip, XFS_IOLOCK_SHARED); - } else if (locktype == VRWLOCK_TRY_WRITE) { - return xfs_ilock_nowait(ip, XFS_IOLOCK_EXCL); - } else { - ASSERT((locktype == VRWLOCK_READ) || - (locktype == VRWLOCK_WRITE_DIRECT)); - xfs_ilock(ip, XFS_IOLOCK_SHARED); - } - - return 1; -} - - -void -xfs_rwunlock( - xfs_inode_t *ip, - bhv_vrwlock_t locktype) -{ - if (S_ISDIR(ip->i_d.di_mode)) - return; - if (locktype == VRWLOCK_WRITE) { - /* - * In the write case, we may have added a new entry to - * the reference cache. This might store a pointer to - * an inode to be released in this inode. If it is there, - * clear the pointer and release the inode after unlocking - * this one. - */ - xfs_refcache_iunlock(ip, XFS_IOLOCK_EXCL); - } else { - ASSERT((locktype == VRWLOCK_READ) || - (locktype == VRWLOCK_WRITE_DIRECT)); - xfs_iunlock(ip, XFS_IOLOCK_SHARED); - } - return; -} - - -int xfs_inode_flush( xfs_inode_t *ip, int flags) Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.h 2007-12-26 16:59:57.000000000 +0100 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.h 2007-12-26 17:03:28.000000000 +0100 @@ -38,8 +38,6 @@ int xfs_readdir(struct xfs_inode *dp, vo int xfs_symlink(struct xfs_inode *dp, bhv_vname_t *dentry, char *target_path, mode_t mode, bhv_vnode_t **vpp, struct cred *credp); -int xfs_rwlock(struct xfs_inode *ip, bhv_vrwlock_t locktype); -void xfs_rwunlock(struct xfs_inode *ip, bhv_vrwlock_t locktype); int xfs_inode_flush(struct xfs_inode *ip, int flags); int xfs_set_dmattrs(struct xfs_inode *ip, u_int evmask, u_int16_t state); int xfs_reclaim(struct xfs_inode *ip); From owner-xfs@oss.sgi.com Thu Jan 3 04:59:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jan 2008 04:59:25 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m03CxHT2017715 for ; Thu, 3 Jan 2008 04:59:21 -0800 X-ASG-Debug-ID: 1199365171-5d1300780000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9067E1221A17 for ; Thu, 3 Jan 2008 04:59:31 -0800 (PST) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id hZV0AEKknJxoc9Gq for ; Thu, 03 Jan 2008 04:59:31 -0800 (PST) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m03CqRF3005494 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 3 Jan 2008 13:52:27 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m03CqRKf005492 for xfs@oss.sgi.com; Thu, 3 Jan 2008 13:52:27 +0100 Date: Thu, 3 Jan 2008 13:52:27 +0100 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] kill xfs_get_dir_entry Subject: [PATCH] kill xfs_get_dir_entry Message-ID: <20080103125227.GB5331@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1199365172 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38458 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5348/Wed Jan 2 21:26:56 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14076 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 Instead of of xfs_get_dir_entry use a macro to get the xfs_inode from the dentry in the callers and grab the reference manually. Only grab the reference once as it's fine to keep it over the dmapi calls. (And even that reference is actually superflous in Linux but I'll leave that for another patch) Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_rename.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_rename.c 2007-11-30 10:15:48.000000000 +0100 +++ linux-2.6-xfs/fs/xfs/xfs_rename.c 2007-12-26 16:35:10.000000000 +0100 @@ -94,7 +94,8 @@ xfs_lock_for_rename( xfs_inode_t **i_tab,/* array of inode returned, sorted */ int *num_inodes) /* number of inodes in array */ { - xfs_inode_t *ip1, *ip2, *temp; + xfs_inode_t *ip1 = VNAME_TO_INODE(vname1); + xfs_inode_t *ip2, *temp; xfs_ino_t inum1, inum2; int error; int i, j; @@ -110,16 +111,11 @@ xfs_lock_for_rename( * to see if we still have the right inodes, directories, etc. */ lock_mode = xfs_ilock_map_shared(dp1); - error = xfs_get_dir_entry(vname1, &ip1); - if (error) { - xfs_iunlock_map_shared(dp1, lock_mode); - return error; - } + IHOLD(ip1); + xfs_itrace_ref(ip1); inum1 = ip1->i_ino; - ASSERT(ip1); - xfs_itrace_ref(ip1); /* * Unlock dp1 and lock dp2 if they are different. Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2007-12-17 14:49:28.000000000 +0100 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2007-12-26 16:35:10.000000000 +0100 @@ -230,7 +230,7 @@ static inline bhv_vnode_t *vn_grab(bhv_v */ #define VNAME(dentry) ((char *) (dentry)->d_name.name) #define VNAMELEN(dentry) ((dentry)->d_name.len) -#define VNAME_TO_VNODE(dentry) (vn_from_inode((dentry)->d_inode)) +#define VNAME_TO_INODE(dentry) (XFS_I((dentry)->d_inode)) /* * Dealing with bad inodes Index: linux-2.6-xfs/fs/xfs/xfs_utils.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_utils.c 2007-12-21 07:22:56.000000000 +0100 +++ linux-2.6-xfs/fs/xfs/xfs_utils.c 2007-12-26 16:35:10.000000000 +0100 @@ -40,28 +40,6 @@ #include "xfs_itable.h" #include "xfs_utils.h" -/* - * xfs_get_dir_entry is used to get a reference to an inode given - * its parent directory inode and the name of the file. It does - * not lock the child inode, and it unlocks the directory before - * returning. The directory's generation number is returned for - * use by a later call to xfs_lock_dir_and_entry. - */ -int -xfs_get_dir_entry( - bhv_vname_t *dentry, - xfs_inode_t **ipp) -{ - bhv_vnode_t *vp; - - vp = VNAME_TO_VNODE(dentry); - - *ipp = xfs_vtoi(vp); - if (!*ipp) - return XFS_ERROR(ENOENT); - VN_HOLD(vp); - return 0; -} int xfs_dir_lookup_int( Index: linux-2.6-xfs/fs/xfs/xfs_utils.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_utils.h 2007-12-17 14:49:28.000000000 +0100 +++ linux-2.6-xfs/fs/xfs/xfs_utils.h 2007-12-26 16:35:10.000000000 +0100 @@ -21,7 +21,6 @@ #define IRELE(ip) VN_RELE(XFS_ITOV(ip)) #define IHOLD(ip) VN_HOLD(XFS_ITOV(ip)) -extern int xfs_get_dir_entry (bhv_vname_t *, xfs_inode_t **); extern int xfs_dir_lookup_int (xfs_inode_t *, uint, bhv_vname_t *, xfs_ino_t *, xfs_inode_t **); extern int xfs_truncate_file (xfs_mount_t *, xfs_inode_t *); Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2007-12-21 07:45:40.000000000 +0100 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2007-12-26 16:35:10.000000000 +0100 @@ -2277,41 +2277,30 @@ xfs_remove( bhv_vnode_t *dir_vp = XFS_ITOV(dp); char *name = VNAME(dentry); xfs_mount_t *mp = dp->i_mount; - xfs_inode_t *ip; + xfs_inode_t *ip = VNAME_TO_INODE(dentry); + int namelen = VNAMELEN(dentry); xfs_trans_t *tp = NULL; int error = 0; xfs_bmap_free_t free_list; xfs_fsblock_t first_block; int cancel_flags; int committed; - int dm_di_mode = 0; int link_zero; uint resblks; - int namelen; xfs_itrace_entry(dp); if (XFS_FORCED_SHUTDOWN(mp)) return XFS_ERROR(EIO); - namelen = VNAMELEN(dentry); - - if (!xfs_get_dir_entry(dentry, &ip)) { - dm_di_mode = ip->i_d.di_mode; - IRELE(ip); - } - if (DM_EVENT_ENABLED(dp, DM_EVENT_REMOVE)) { error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, dir_vp, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, - name, NULL, dm_di_mode, 0, 0); + name, NULL, ip->i_d.di_mode, 0, 0); if (error) return error; } - /* From this point on, return through std_return */ - ip = NULL; - /* * We need to get a reference to ip before we get our log * reservation. The reason for this is that we cannot call @@ -2324,13 +2313,7 @@ xfs_remove( * when we call xfs_iget. Instead we get an unlocked reference * to the inode before getting our log reservation. */ - error = xfs_get_dir_entry(dentry, &ip); - if (error) { - REMOVE_DEBUG_TRACE(__LINE__); - goto std_return; - } - - dm_di_mode = ip->i_d.di_mode; + IHOLD(ip); xfs_itrace_entry(ip); xfs_itrace_ref(ip); @@ -2474,7 +2457,7 @@ xfs_remove( (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, dir_vp, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, - name, NULL, dm_di_mode, error, 0); + name, NULL, ip->i_d.di_mode, error, 0); } return error; @@ -2891,14 +2874,13 @@ xfs_rmdir( char *name = VNAME(dentry); int namelen = VNAMELEN(dentry); xfs_mount_t *mp = dp->i_mount; - xfs_inode_t *cdp; /* child directory */ + xfs_inode_t *cdp = VNAME_TO_INODE(dentry); xfs_trans_t *tp; int error; xfs_bmap_free_t free_list; xfs_fsblock_t first_block; int cancel_flags; int committed; - int dm_di_mode = S_IFDIR; int last_cdp_link; uint resblks; @@ -2907,24 +2889,15 @@ xfs_rmdir( if (XFS_FORCED_SHUTDOWN(mp)) return XFS_ERROR(EIO); - if (!xfs_get_dir_entry(dentry, &cdp)) { - dm_di_mode = cdp->i_d.di_mode; - IRELE(cdp); - } - if (DM_EVENT_ENABLED(dp, DM_EVENT_REMOVE)) { error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, dir_vp, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, - name, NULL, dm_di_mode, 0, 0); + name, NULL, cdp->i_d.di_mode, 0, 0); if (error) return XFS_ERROR(error); } - /* Return through std_return after this point. */ - - cdp = NULL; - /* * We need to get a reference to cdp before we get our log * reservation. The reason for this is that we cannot call @@ -2937,13 +2910,7 @@ xfs_rmdir( * when we call xfs_iget. Instead we get an unlocked reference * to the inode before getting our log reservation. */ - error = xfs_get_dir_entry(dentry, &cdp); - if (error) { - REMOVE_DEBUG_TRACE(__LINE__); - goto std_return; - } - mp = dp->i_mount; - dm_di_mode = cdp->i_d.di_mode; + IHOLD(cdp); /* * Get the dquots for the inodes. @@ -3100,7 +3067,7 @@ xfs_rmdir( (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, dir_vp, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, - name, NULL, dm_di_mode, + name, NULL, cdp->i_d.di_mode, error, 0); } return error; From owner-xfs@oss.sgi.com Thu Jan 3 07:55:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jan 2008 07:55:46 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,BAYES_05,HTML_MESSAGE, J_CHICKENPOX_45,J_CHICKENPOX_52,J_CHICKENPOX_62 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m03FtdNU032573 for ; Thu, 3 Jan 2008 07:55:41 -0800 X-ASG-Debug-ID: 1199375752-5d13022b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from SVITS26.main.ad.rit.edu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E849BBE7DA1 for ; Thu, 3 Jan 2008 07:55:52 -0800 (PST) Received: from SVITS26.main.ad.rit.edu (svits26.main.ad.rit.edu [129.21.18.136]) by cuda.sgi.com with ESMTP id dppxY1M4kXM8rR1Z for ; Thu, 03 Jan 2008 07:55:52 -0800 (PST) X-MIMEOLE: Produced By Microsoft Exchange V6.5 MIME-Version: 1.0 X-ASG-Orig-Subj: RE: xfs_force_shutdown called from file fs/xfs/xfs_trans_buf.c Subject: RE: xfs_force_shutdown called from file fs/xfs/xfs_trans_buf.c Date: Thu, 3 Jan 2008 10:55:48 -0500 Message-ID: <06CCEA2EB1B80A4A937ED59005FA855101C81060@svits26.main.ad.rit.edu> In-reply-to: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: xfs_force_shutdown called from file fs/xfs/xfs_trans_buf.c Thread-Index: AchDdWO5l6pL6hlRTjGk3QiXs2sgCwKqss9g References: From: "Jay Sullivan" To: Cc: "Jay Sullivan" X-Barracuda-Connect: svits26.main.ad.rit.edu[129.21.18.136] X-Barracuda-Start-Time: 1199375752 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38470 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/5348/Wed Jan 2 21:26:56 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 16273 X-archive-position: 14077 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpspgd@rit.edu Precedence: bulk X-list: xfs I'm still seeing a lot of the following in my dmesg. Any ideas? See below for what I have already tried (including moving data to a fresh XFS volume). Tons of these; sometimes the want= changes, but it is always huge. ### attempt to access beyond end of device dm-0: rw=0, want=68609558288793608, limit=8178892800 I/O error in filesystem ("dm-0") meta-data dev dm-0 block 0xf3c0079e000000 ("xfs_trans_read_buf") error 5 buf count 4096 ### Occasionally some of these: ### XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4533 of file fs/xfs/xfs_bmap.c. Caller 0xc028c5a2 [] xfs_bmap_read_extents+0x3bd/0x498 [] xfs_iread_extents+0x74/0xe1 [] xfs_iext_realloc_direct+0xa4/0xe7 [] xfs_iex t;c028c5a2>] xfs_iread_extents+0x74/0xe1 [] xfs_bmapi+0x1ca/0x173f [] elv_rb_add+0x6f/0x88 [] as_update_rq+0x32/0x72 [] as_add_request+0x76/0xa4 [] elv_insert+0xd5/0x142 [] __make_request+0xc8/0x305 [] generic_make_request+0x122/0x1d9 [] __map_bio+0x33/0xa9 [] __clone_and_map+0xda/0x34c [] mempool_alloc+0x2a/0xdb [] xfs_ilock+0x58/0xa0 [] xfs_iomap+0x216/0x4b7 [] __xfs_get_blocks+0x6b/0x226 [] radix_tree_node_alloc+0x16/0x57 [] radix_tree_insert+0xb0/0x126 [] xfs_get_blocks+0x28/0x2d [] block_read_full_page+0x192/0x346 [] xfs_get_blocks+0x0/0x2d [] xfs_iget+0x145/0x150 [] do_mpage_readpag 28aba1>] xfs_iunlock+0x43/0x84 [] xfs_vget+0xe1/0xf2 [] find_exported_dentry+0x71/0x4b6 [] __do_page_cache_readahead+0x88/0x153 [] mpage_readpage+0x4b/0x5e [] xfs_get_blocks+0x0/0x2d [] blockable_page_cache_readahead+0x4d/0xb9 [] page_cache_readahead+0x174/0x1a3 [] find_get_page+0x18/0x3a [] do_generic_mapping_read+0x1b5/0x535 [] __capable+0x8/0x1b [] generic_file_sendfile+0x68/0x83 [] nfsd_read_actor+0x0/0x10f [] xfs_sendfile+0x94/0x164 [] nfsd_read_actor+0x0/0x10f [] nfsd_permission+0x6e/0x103 [] xfs_file_sendfile+0x4c/0x5c [] nfsd_read_actor+0x0/0x10f [] nfsd_vfs_read+0x344/0x361 [] nfsd_read_actor+0x0/0x ] nfsd_read+0xd8/0xf9 [] nfsd3_proc_read+0xb0/0x174 [] nfs3svc_decode_readargs+0x0/0xf7 [] nfsd_dispatch+0x8a/0x1f5 [] svcauth_unix_set_client+0x11d/0x175 [] svc_process+0x4fd/0x681 [] nfsd+0x163/0x273 [] nfsd+0x0/0x273 [] kernel_thread_helper+0x7/0x10 ### Thanks! ~Jay From: Jay Sullivan [mailto:jpspgd@rit.edu] Sent: Thursday, December 20, 2007 9:01 PM To: xfs@oss.sgi.com Cc: Jay Sullivan Subject: Re: xfs_force_shutdown called from file fs/xfs/xfs_trans_buf.c I'm still seeing problems. =( Most recently I have copied all of the data off of the suspect XFS volume onto another fresh XFS volume. A few days later I saw the same messages show up in dmesg. I haven't had a catastrophic failure that makes the kernel remount the FS RO, but I don't want to wait for that to happen. Today I upgraded to the latest stable kernel in Gentoo (2.6.23-r3) and I'm still on xfsprogs 2.9.4, also the latest stable release. A few hours after rebooting to load the new kernel, I saw the following in dmesg: #################### attempt to access beyond end of device dm-0: rw=0, want=68609558288793608, limit=8178892800 I/O error in files dev dm-0 block 0xf3c0079e000000 ("xfs_trans_read_buf") error 5 buf count 4096 attempt to access beyond end of device dm-0: rw=0, want=68609558288793608, limit=8178892800 I/O error in filesystem ("dm-0") meta-data dev dm-0 block 0xf3c0079e000000 ("xfs_trans_read_buf") error 5 buf count 4096 attempt to access beyond end of device dm-0: rw=0, want=68609558288793608, limit=8178892800 I/O error in filesystem ("dm-0") meta-data dev dm-0 block 0xf3c0079e000000 ("xfs_trans_read_buf") error 5 buf count 4096 attempt to access beyond end of device dm-0: rw=0, want=68609558288793608, limit=8178892800 I/O error in filesystem ("dm-0") meta-data dev dm-0 block 0xf3c0079e000000 ("xfs_trans_read_buf") error 5 buf count 4096 ################### These are the same to access a block that is WAAAY outside of the range of my drives) that I was seeing before the last time my FS got remounted read-only by the colonel. Any ideas? What other information can I gather that would help with troubleshooting? Here are some more specifics: This is a Dell PowerEdge 1850 with a FusionMPT/LSI fibre channel card. The XFS volume is a 3.9TB logical volume in LVM. The volume group is spread across LUNs of a Apple XServe RAIDs which are connected o'er FC to our fabric. I just swapped FC switches (to a different brand even) and the problem was showing before and after the switch switch, so that's not it. I have also swapped FC cards, upgraded FC card firmware, updated BIOSs, etc.. This server sees heavy NFS (v3) and samba (currently 3.0.24 until the current regression bug is squashed and stable) traffic. usually sees 200-300Mbps throughput 24/7, although sometimes more. Far-fetched: Is there any way that a particular file on my FS, when accessed, is causing the problem? I have a very similar system (Dell PE 2650, same FC card, same type of RAID, same SFP cables, same GPT scheme, same kernel) but instead with an ext3 (full journal) FS in a 5.[something]TB logical volume (LVM) with no problems. Oh, and it sees system load values in the mid-20s just about all day. Grasping at straws. I need XFS to work because we'll soon be requiring seriously large filesystems with non-sucky extended attribute and ACL support. Plus it's fast and I like it. Can the XFS community help? I don't want to have to turn to that guy that a =P ~Jay On Nov 14, 2007, at 10:05 AM, Jay Sullivan wrote: Of course this had to happen one more time before my scheduled maintenance window... Anyways, here's all of the good stuff I collected. Can anyone make sense of it? Oh, and I upgraded to xfsprogs 2.9.4 last week, so all output you see is with that version. Thanks! ################### dmesg output ################### XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4533 of file fs/xfs/xfs_bmap.c. Caller 0xc028c5a2 [] xfs_bmap_read_extents+0x3bd/0x498 [] xfs_iread_extents+0x74/0xe1 [] xfs_iext_realloc_direct+0xa4/0xe7 [] xfs_iex t;c028c5a2>] xfs_iread_extents+0x74/0xe1 [] xfs_bmapi+0x1ca/0x173f [] elv_rb_add+0x6f/0x88 [] as_update_rq+0x32/0x72 [] as_add_request+0x76/0xa4 [] elv_insert+0xd5/0x142 [] __make_request+0xc8/0x305 [] generic_make_request+0x122/0x1d9 [] __map_bio+0x33/0xa9 [] __clone_and_map+0xda/0x34c [] mempool_alloc+0x2a/0xdb [] xfs_ilock+0x58/0xa0 [] xfs_iomap+0x216/0x4b7 [] __xfs_get_blocks+0x6b/0x226 [] radix_tree_node_alloc+0x16/0x57 [] radix_tree_insert+0xb0/0x126 [] xfs_get_blocks+0x28/0x2d [] block_read_full_page+0x192/0x346 [] xfs_get_blocks+0x0/0x2d [] xfs_iget+0x145/0x150 [] do_mpage_readpag 28aba1>] xfs_iunlock+0x43/0x84 [] xfs_vget+0xe1/0xf2 [] find_exported_dentry+0x71/0x4b6 [] __do_page_cache_readahead+0x88/0x153 [] mpage_readpage+0x4b/0x5e [] xfs_get_blocks+0x0/0x2d [] blockable_page_cache_readahead+0x4d/0xb9 [] page_cache_readahead+0x174/0x1a3 [] find_get_page+0x18/0x3a [] do_generic_mapping_read+0x1b5/0x535 [] __capable+0x8/0x1b [] generic_file_sendfile+0x68/0x83 [] nfsd_read_actor+0x0/0x10f [] xfs_sendfile+0x94/0x164 [] nfsd_read_actor+0x0/0x10f [] nfsd_permission+0x6e/0x103 [] xfs_file_sendfile+0x4c/0x5c [] nfsd_read_actor+0x0/0x10f [] nfsd_vfs_read+0x344/0x361 [] nfsd_read_actor+0x0/0x ] nfsd_read+0xd8/0xf9 [] nfsd3_proc_read+0xb0/0x174 [] nfs3svc_decode_readargs+0x0/0xf7 [] nfsd_dispatch+0x8a/0x1f5 [] svcauth_unix_set_client+0x11d/0x175 [] svc_process+0x4fd/0x681 [] nfsd+0x163/0x273 [] nfsd+0x0/0x273 [] kernel_thread_helper+0x7/0x10 ======================= attempt to access beyond end of device dm-1: rw=0, want=6763361770196172808, limit=7759462400 I/O error in filesystem ("dm-1") meta-data dev dm-1 block 0x5ddc49b238000000 ("xfs_trans_read_buf") error 5 buf count 4096 xfs_force_shutdown(dm-1,0x1) called from line 415 of file fs/xfs/xfs_trans_buf.c. Return address = 0xc02baa25 Filesystem "dm-1": I/O Error Detected. Shutting down filesystem: dm-1 Please umount the filesystem, and rectify the problem(s) #################### I umount'ed and mount'ed the FS several times, but xfs_repair still told me to use -L... Any ideas? ####################### server-files ~ # umount /mnt/san/ server-files ~ # mount /mnt/san/ server-files ~ # umount /mnt/san/ server-files ~ # xfs_repair /dev/server-files-sanvg01/server-files-sanlv01 Phase 1 - find and verify superblock... Phase 2 - using internal log - zero log... ERROR: The filesystem has valuable metadata changes in a log which needs to be replayed. Mount the filesystem to replay the log, and unmount it before re-running xfs_repair. If you are unable to mount the filesystem, then use the -L option to destroy the log and attempt a repair. Note that destroying the log may cause corruption -- please attempt a mount of the filesystem before doing this. server-files ~ # xfs_repair -L /dev/server-files-sanvg01/server-files-sanlv01 Pha perblock... Phase 2 - using internal log - zero log... ALERT: The filesystem has valuable metadata changes in a log which is being destroyed because the -L option was used. - 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 4002: Badness in key lookup (length) bp=(bno 2561904, len 16384 bytes) key=(bno 2561904, len 8192 bytes) 8003: Badness in key lookup (length) bp=(bno 0, len 512 bytes) key=(bno 0, len 4096 bytes) bad bmap btree ptr 0x5f808b0400000000 in ino 5123809 bad data fork in inode 5123809 cleared inode 5123809 bad magi 480148 (data fork) bmbt block 0 bad data fork in inode 7480148 cleared inode 7480148 - agno = 1 - agno = 2 - agno = 3 - agno = 4 - process newly discovered inodes... Phase 4 - check for duplicate blocks... - setting up duplicate extent list... - check for inodes claiming duplicate blocks... - agno = 0 - agno = 1 - agno = 2 - agno = 3 - agno = 4 entry "Fuller_RotoscopeCorrected.mov" at block 0 offset 184 in directory inode 89923 7480148 clearing inode number in entry at offset 184... Phase 5 - rebuild AG headers and trees... - reset superblock... 4000: Badness in key lookup (length) bp=(bno 0, len 4096 bytes) key=(bno 0, len 512 bytes) Phase 6 - check inode connectivity... - resetting contents of realtime bitmap and summary inodes - traversing filesystem ... bad hash table for directory inode 8992373 (no data entry): rebuilding rebuilding directory inode 8992373 4000: Badness in key lookup (length) bp=(bno 0, len 4096 bytes) key=(bno 0, len 512 bytes) 4000: Badness in key lookup (length) bp=(bno 0, len 4096 bytes) key=(bno 0, len 512 bytes) - traversal finished ... - moving disconnected inodes to lost+found nd correct link counts... 4000: Badness in key lookup (length) bp=(bno 0, len 4096 bytes) key=(bno 0, len 512 bytes) done server-files ~ # mount /mnt/san server-files ~ # umount /mnt/san server-files ~ # xfs_repair -L /dev/server-files-sanvg01/server-files-sanlv01 Phase 1 - find and verify superblock... Phase 2 - using internal log - zero log... server-files ~ # xfs_repair /dev/server-files-sanvg01/server-files-sanlv01 Phase 1 - find and verify superblock... Phase 2 - using internal log - zero log... XFS: totally zeroed log - scan filesystem freespace and inode maps... - found root inode chunk Phase 3 - for each AG... - scan and clear agi unlinked lists... - proc orm inode discovery... - agno = 0 - agno = 1 - agno = 2 - agno = 3 - agno = 4 - process newly discovered inodes... Phase 4 - check for duplicate blocks... - setting up duplicate extent list... - check for inodes claiming duplicate blocks... - agno = 0 - agno = 1 - agno = 2 - agno = 3 - agno = 4 Phase 5 - rebuild AG headers and trees... - reset su check inode connectivity... - resetting contents of realtime bitmap and summary inodes - traversing filesystem ... - traversal finished ... - moving disconnected inodes to lost+found ... Phase 7 - verify and correct link counts... done ################ So that's it for now. Next week I'll be rsyncing all of the data off of this volume to another array. I still want to know what's happening, though... *pout* Anyways, thanks a lot for everyone's help. ~Jay -----Original Message----- From: xfs-bounce@oss.sgi.com [mailto:xfs-bounce@oss.sgi.com] On Behalf Of Jay Sullivan Sent: Friday, November 02, 2007 10:49 AM To: xfs@oss.sgi.com Subject: RE: xf rom file fs/xfs/xfs_trans_buf.c What can I say about Murphy and his silly laws? I just had a drive fail on my array. I wonder if this is the root of my problems... Yay parity. ~Jay -----Original Message----- From: xfs-bounce@oss.sgi.com [mailto:xfs-bounce@oss.sgi.com] On Behalf Of Jay Sullivan Sent: Friday, November 02, 2007 10:00 AM To: xfs@oss.sgi.com Subject: RE: xfs_force_shutdown called from file fs/xfs/xfs_trans_buf.c I lost the xfs_repair output on an xterm with only four lines of scrollback... I'll definitely be more careful to preserve more 'evidence' next time. =( "Pics or it didn't happen", right? I just upgraded xfsprogs and will scan the disk during my next scheduled downtime (probably in about 2 weeks). I'm tempted to just wipe the volume and start over: I have enough ' to copy everything out to a fresh XFS volume. Regarding "areca": I'm using hardware RAID built into Apple XServe RAIDs o'er LSI FC929X cards. Someone else offered the likely explanation that the btree is corrupted. Isn't this something xfs_repair should be able to fix? Would it be easier, safer, and faster to move the data to a new volume (and restore corrupted files if/as I find them from backup)? We're talking about just less than 4TB of data which used to take about 6 hours to fsck (one pass) with ext3. Restoring the whole shebang from backups would probably take the better part of 12 years (waiting for compression, resetting ACLs, etc.)... FWIW, another (way less important,) much busier and significantly larger logical volume on the same array has been totally fine. Murphy--go figure. Thanks! -----Original Message----- From: Eric Sandeen [mail >] Sent: Thursday, November 01, 2007 10:30 PM To: Jay Sullivan Cc: xfs@oss.sgi.com Subject: Re: xfs_force_shutdown called from file fs/xfs/xfs_trans_buf.c Jay Sullivan wrote: Good eye: it wasn't mountable, thus the -L flag. No recent (unplanned) power outages. The machine and the array that holds the disks are both on serious batteries/UPS and the array's cache batteries are in good health. Did you have the xfs_repair output to see what it found? You might also grab the very latest xfsprogs (2.9.4) in case it's catching more cases. I hate it when people suggest running memtest86, but I might do that anyway. :) What controller are you using? If you say "areca" I might be on to something e seen... -Eric [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Thu Jan 3 10:33:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jan 2008 10:33:16 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m03IX6dF023297 for ; Thu, 3 Jan 2008 10:33:10 -0800 X-ASG-Debug-ID: 1199385198-346e02610000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CB9844DF7E3 for ; Thu, 3 Jan 2008 10:33:18 -0800 (PST) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 917VMrUQZw5HNkad for ; Thu, 03 Jan 2008 10:33:18 -0800 (PST) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m03IXCF3023316 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 3 Jan 2008 19:33:12 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m03IXCe3023314 for xfs@oss.sgi.com; Thu, 3 Jan 2008 19:33:12 +0100 Date: Thu, 3 Jan 2008 19:33:12 +0100 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] don't encode parent in nfs filehandles unless nessecary Subject: [PATCH] don't encode parent in nfs filehandles unless nessecary Message-ID: <20080103183311.GA23209@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1199385201 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38481 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5349/Thu Jan 3 07:57:19 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14078 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs As Dave pointed out after the export ops changes we now always encode the parent into the filehandle for regular files, but it's not actually needed when the filesystem is export with no_subtree_check. This one-liner fixes xfs_fs_encode_fh to skip encoding the parent unless nessecary. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_export.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_export.c 2008-01-02 17:02:48.000000000 +0100 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_export.c 2008-01-03 19:30:51.000000000 +0100 @@ -66,7 +66,7 @@ xfs_fs_encode_fh( int len; /* Directories don't need their parent encoded, they have ".." */ - if (S_ISDIR(inode->i_mode)) + if (S_ISDIR(inode->i_mode) || !connectable) fileid_type = FILEID_INO32_GEN; else fileid_type = FILEID_INO32_GEN_PARENT; From owner-xfs@oss.sgi.com Thu Jan 3 21:35:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jan 2008 21:35:55 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,HTML_MESSAGE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m045ZOIC003862 for ; Thu, 3 Jan 2008 21:35:26 -0800 X-ASG-Debug-ID: 1199424909-1017018a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from py-out-1112.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 51EFABEF20F for ; Thu, 3 Jan 2008 21:35:09 -0800 (PST) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.176]) by cuda.sgi.com with ESMTP id RygloFF33oBID1LP for ; Thu, 03 Jan 2008 21:35:09 -0800 (PST) Received: by py-out-1112.google.com with SMTP id j37so8922208pyc.4 for ; Thu, 03 Jan 2008 21:35:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=3NCPvD2AXAS+xUHOG6aSdgpNfG1MrkXB2TRkxp4AUyE=; b=W1CI6gUwQ43ZULSv3XF3qAXnkCUfMukePL5qUE52tTzYa8WzN4woskPqHDhL4eIKD8NAY2OroqNN9Wiqk2ZZKjogFgZAcZpCB5UsydHd5VKfOeRB69zkyJqQuuV0vORkXWWCYziSaDomAzrwxuIQwDoKlYqlXcvfXuV7AAL5dKw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=CNc/nNoXk+Z6+59xPZwxQ1Vutnf/916fbk8mbVdD1kBwlaSv4uYMopg9/u6p/VlNH8amgXBqXs/fzc/j7uKSO6qn+9+cbiTDotSoLb1xxJqW76TEspoR7v2/ZR3CHkJZCyVMhVqR/d+FX0MidYb8K3rxl6Gp5azAQ4EE/TqWUis= Received: by 10.143.36.15 with SMTP id o15mr3228970wfj.182.1199424907915; Thu, 03 Jan 2008 21:35:07 -0800 (PST) Received: by 10.142.51.7 with HTTP; Thu, 3 Jan 2008 21:35:07 -0800 (PST) Message-ID: Date: Fri, 4 Jan 2008 13:35:07 +0800 From: "Changliang Chen" To: "Justin Piszcz" X-ASG-Orig-Subj: Re: New XFS benchmarks using David Chinner's recommendations for XFS-based optimizations. Subject: Re: New XFS benchmarks using David Chinner's recommendations for XFS-based optimizations. Cc: xfs@oss.sgi.com, linux-raid@vger.kernel.org, "Alan Piszcz" In-Reply-To: MIME-Version: 1.0 References: X-Barracuda-Connect: py-out-1112.google.com[64.233.166.176] X-Barracuda-Start-Time: 1199424912 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38525 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/5356/Thu Jan 3 21:05:24 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 225 X-archive-position: 14079 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hqucocl@gmail.com Precedence: bulk X-list: xfs Hi Justin=A3=AC From your report=A3=ACIt looks that the p34-default's behavior is better=A3=ACwhich item make you consider that the p34-dchinner looks nice= =A3=BF --=20 Best Regards [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Fri Jan 4 01:08:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 04 Jan 2008 01:08:13 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m04984No028606 for ; Fri, 4 Jan 2008 01:08:07 -0800 X-ASG-Debug-ID: 1199437699-59b200290000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1C785BF0B95 for ; Fri, 4 Jan 2008 01:08:19 -0800 (PST) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id ELPUCxUKQHIDSZPE for ; Fri, 04 Jan 2008 01:08:19 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by lucidpixels.com (Postfix) with ESMTP id D43201C000EE6; Fri, 4 Jan 2008 04:07:48 -0500 (EST) X-Virus-Scanned: ClamAV 0.91.2/5359/Thu Jan 3 21:37:46 2008 on oss.sgi.com X-Virus-Scanned: Debian amavisd-new at lucidpixels.com Received: from lucidpixels.com ([127.0.0.1]) by localhost (p34.internal.lan [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Lb4O+DSQ-CdT; Fri, 4 Jan 2008 04:07:48 -0500 (EST) Received: by lucidpixels.com (Postfix, from userid 1001) id A5DC21C000EE5; Fri, 4 Jan 2008 04:07:48 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by lucidpixels.com (Postfix) with ESMTP id A4825409046C; Fri, 4 Jan 2008 04:07:48 -0500 (EST) Date: Fri, 4 Jan 2008 04:07:48 -0500 (EST) From: Justin Piszcz X-X-Sender: jpiszcz@p34.internal.lan To: Changliang Chen cc: xfs@oss.sgi.com, linux-raid@vger.kernel.org, Alan Piszcz X-ASG-Orig-Subj: Re: New XFS benchmarks using David Chinner's recommendations for XFS-based optimizations. Subject: Re: New XFS benchmarks using David Chinner's recommendations for XFS-based optimizations. In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463747160-260479212-1199437668=:19036" X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1199437700 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38539 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Status: Clean X-archive-position: 14080 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463747160-260479212-1199437668=:19036 Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 4 Jan 2008, Changliang Chen wrote: > Hi Justin=A3=AC From your report=A3=ACIt looks that the p34-default's behavior is better=A3=ACwhich item make you consider that the p34-dchinner looks nice= =A3=BF --=20 Best Regards The re-write and sequential input and output is faster for dchinner. Justin. ---1463747160-260479212-1199437668=:19036-- From owner-xfs@oss.sgi.com Fri Jan 4 07:35:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 04 Jan 2008 07:35:47 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=BAYES_50,WHOIS_MYPRIVREG autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m04FZdfB002309 for ; Fri, 4 Jan 2008 07:35:42 -0800 X-ASG-Debug-ID: 1199460951-494a02650000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from kuber.nabble.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DCEABBF2D9A for ; Fri, 4 Jan 2008 07:35:51 -0800 (PST) Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) by cuda.sgi.com with ESMTP id CWAiQm1Y48Zfo9w3 for ; Fri, 04 Jan 2008 07:35:51 -0800 (PST) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1JAoZr-0004SN-Il for xfs@oss.sgi.com; Fri, 04 Jan 2008 07:35:19 -0800 Message-ID: <14618811.post@talk.nabble.com> Date: Fri, 4 Jan 2008 07:35:19 -0800 (PST) From: Web Design Company To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Website Design Subject: Re: Website Design In-Reply-To: <000301c5733d$04551010$9400a8c0@XMEN.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: web_design_company@ooyes.net References: <000301c5733d$04551010$9400a8c0@XMEN.local> X-Barracuda-Connect: kuber.nabble.com[216.139.236.158] X-Barracuda-Start-Time: 1199460954 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38564 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5363/Fri Jan 4 05:37:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14081 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: web_design_company@ooyes.net Precedence: bulk X-list: xfs Hello, nice site Check out site. Officially we are a creative webdesign and outsourcing agency and we do high-quality web solutions. OOYES.NET eagerly helps businesses and individual clients all over the World to establish and maintain a professional Internet presence. http://ooyes.net Web Design Company ----- http://ooyes.net Web design company | http://ooyes.net Graphic design company | http://ooyes.net Outsourcing company -- View this message in context: http://www.nabble.com/Website-Design-tp223981p14618811.html Sent from the Xfs - General mailing list archive at Nabble.com. From owner-xfs@oss.sgi.com Fri Jan 4 14:04:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 04 Jan 2008 14:04:25 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m04M4KZY011011 for ; Fri, 4 Jan 2008 14:04:20 -0800 X-ASG-Debug-ID: 1199484270-02ca01740000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 25522BF95DC for ; Fri, 4 Jan 2008 14:04:30 -0800 (PST) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id X47CJ8ui2OBOo4kT for ; Fri, 04 Jan 2008 14:04:30 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by lucidpixels.com (Postfix) with ESMTP id D49891C000EF7 for ; Fri, 4 Jan 2008 17:04:29 -0500 (EST) X-Virus-Scanned: ClamAV 0.91.2/5366/Fri Jan 4 12:20:10 2008 on oss.sgi.com X-Virus-Scanned: Debian amavisd-new at lucidpixels.com Received: from lucidpixels.com ([127.0.0.1]) by localhost (p34.internal.lan [127.0.0.1]) (amavisd-new, port 10024) with LMTP id iL9EkKQm31JJ for ; Fri, 4 Jan 2008 17:04:27 -0500 (EST) Received: by lucidpixels.com (Postfix, from userid 1001) id 87A021C0000A9; Fri, 4 Jan 2008 17:04:27 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by lucidpixels.com (Postfix) with ESMTP id 7CE79408F24E for ; Fri, 4 Jan 2008 17:04:27 -0500 (EST) Date: Fri, 4 Jan 2008 17:04:27 -0500 (EST) From: Justin Piszcz X-X-Sender: jpiszcz@p34.internal.lan To: xfs@oss.sgi.com X-ASG-Orig-Subj: external log doubles performance? Subject: external log doubles performance? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1199484276 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38588 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Status: Clean X-archive-position: 14082 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs from a linux-admin page/post: Mon Jul 3 14:22:45 PDT 2006 10 clients started .......................+......+.......+++++....+********* Throughput 182.083 MB/sec (NB=227.604 MB/sec 1820.83 MBit/sec) 10 procs Mon Jul 3 14:22:52 PDT 2006 When the logbufs and logbsize options are added, throughput increases from 92.7404 MB/sec to 96.4556 MB/sec. When the log is moved to an external device the throughput nearly doubles to 182.083 MB/sec. Clearly, the external log increases file system performance under dbench, a program that has a large amount of metadata activity. Tuning the I/O Scheduler -- has anyone done any recent testing? From owner-xfs@oss.sgi.com Sun Jan 6 15:22:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jan 2008 15:22:44 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m06NMXKG024897 for ; Sun, 6 Jan 2008 15:22:38 -0800 X-ASG-Debug-ID: 1199661767-6aa500580000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from postoffice.aconex.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B1DFA4ECF23 for ; Sun, 6 Jan 2008 15:22:47 -0800 (PST) Received: from postoffice.aconex.com (prod.aconex.com [203.89.192.138]) by cuda.sgi.com with ESMTP id DOV5lv1aOoOcUCpy for ; Sun, 06 Jan 2008 15:22:47 -0800 (PST) Received: from edge.scott.net.au (unknown [203.89.192.141]) by postoffice.aconex.com (Postfix) with ESMTP id 740EC92CD60; Mon, 7 Jan 2008 10:22:13 +1100 (EST) X-ASG-Orig-Subj: Re: how remove project quota Subject: Re: how remove project quota From: Nathan Scott Reply-To: nscott@aconex.com To: Nelzinho Rocha Cc: xfs@oss.sgi.com In-Reply-To: <3b8ebef50712280418l663cafadm80f884f43dfd3a15@mail.gmail.com> References: <3b8ebef50712280418l663cafadm80f884f43dfd3a15@mail.gmail.com> Content-Type: text/plain Organization: Aconex Date: Mon, 07 Jan 2008 10:24:46 +1100 Message-Id: <1199661886.9463.4.camel@edge.scott.net.au> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: prod.aconex.com[203.89.192.138] X-Barracuda-Start-Time: 1199661769 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38787 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5390/Sun Jan 6 15:01:04 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14083 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: nscott@aconex.com Precedence: bulk X-list: xfs On Fri, 2007-12-28 at 10:18 -0200, Nelzinho Rocha wrote: > Hello, > > how remove a project quota? > > Would be sufficient remove project quota the files /etc/projid and > /etc/projects? Or have to do something else? See the xfs_quota man page, in particular the expert-mode "off" and "remove" commands. cheers. -- Nathan From owner-xfs@oss.sgi.com Sun Jan 6 18:00:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jan 2008 18:01:14 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0720lTW006272 for ; Sun, 6 Jan 2008 18:00:48 -0800 X-ASG-Debug-ID: 1199671261-053a003a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ug-out-1314.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DFA76C07706 for ; Sun, 6 Jan 2008 18:01:01 -0800 (PST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.170]) by cuda.sgi.com with ESMTP id oMqXXgfVoTXTNVCD for ; Sun, 06 Jan 2008 18:01:01 -0800 (PST) Received: by ug-out-1314.google.com with SMTP id o29so3456208ugd.20 for ; Sun, 06 Jan 2008 18:01:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=WWz7jfXqX1sCdoP0m9ie92TGYflTHrMNXhJZFaWJ9lw=; b=B9eWxxVdakFGJHoaCXVVTUS24ZVUOBaIxSdPsJNLENodeHSsLpWQq7scFIMjcuY/RBqfA5jUcQEqFIrEqV6TsThBqT5y0cUtw+GxXEDx1Hld9dLkNeq0UdhLoUkpu5OWhlb40/hNslZP0sNtUP6GPLwmkngZqYhJiRCMsczNrAc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=hSEwOdvZbPh6dNlrp25Nkxd/UMqAqi31UGX79zrhYKTb1A57SB3kWPmbESwTVykIQAIidnCNJw2n4Z1XgoGfZkCq0X96oyWyANxfi2O7Q8MgIpI8oh1lnTzhzyEgtB3/wtdgy4QVTR4moIyynO7x688jPGnNpqS7CTgRYjSR8Ko= Received: by 10.67.115.1 with SMTP id s1mr7966888ugm.74.1199671260527; Sun, 06 Jan 2008 18:01:00 -0800 (PST) Received: by 10.66.242.18 with HTTP; Sun, 6 Jan 2008 18:01:00 -0800 (PST) Message-ID: <96c268400801061801i62853e5xdda1b93cc864dda5@mail.gmail.com> Date: Mon, 7 Jan 2008 05:01:00 +0300 From: "Maxim Gordienko" To: xfs@oss.sgi.com X-ASG-Orig-Subj: xfs_repair core dump Subject: xfs_repair core dump MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Barracuda-Connect: ug-out-1314.google.com[66.249.92.170] X-Barracuda-Start-Time: 1199671263 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38796 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5395/Sun Jan 6 16:42:23 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14084 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: mgordienko@gmail.com Precedence: bulk X-list: xfs Hello! I'm trying to repair damaged xfs partition, but xfs_repair crashes with core dump distribution is fully updated ubuntu 7.10, xfsprogs are 2.9.0. Have tried xfs_repair from other dists like knoppix or gparted livecd, compiled from source last stable (2.9.4-1) same result. Could you please help? Thank you. Phase 5 - rebuild AG headers and trees... *** glibc detected *** xfs_repair: munmap_chunk(): invalid pointer: 0xb514d008 *** ======= Backtrace: ========= /lib/tls/i686/cmov/libc.so.6(cfree+0x1bb)[0xb7ead92b] xfs_repair[0x8062d9a] xfs_repair[0x806c896] xfs_repair[0x8080515] /lib/tls/i686/cmov/libpthread.so.0[0xb7f9846b] /lib/tls/i686/cmov/libc.so.6(clone+0x5e)[0xb7f136de] From owner-xfs@oss.sgi.com Sun Jan 6 19:36:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jan 2008 19:37:02 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m073avsO012555 for ; Sun, 6 Jan 2008 19:36:58 -0800 X-ASG-Debug-ID: 1199677032-501400280000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 95A414ED9AE for ; Sun, 6 Jan 2008 19:37:13 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id Y0dnVMm7uQpxSBTH for ; Sun, 06 Jan 2008 19:37:13 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 58F3E18003F13 for ; Sun, 6 Jan 2008 21:36:40 -0600 (CST) Message-ID: <47819E47.4030906@sandeen.net> Date: Sun, 06 Jan 2008 21:36:39 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: xfs-oss X-ASG-Orig-Subj: [PATCH] remove CONFIG_XFS_SECURITY Subject: [PATCH] remove CONFIG_XFS_SECURITY Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1199677033 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38803 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5400/Sun Jan 6 18:40:34 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14085 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 Is there any point to this option? Sure, it disables the ability to set security attributes at runtime, but it doesn't slim down any code. Any reason to not remove it, and always allow security attributes to be set? Signed-off-by: Eric Sandeen --- Index: linux-2.6.24-rc3/fs/xfs/Kconfig =================================================================== --- linux-2.6.24-rc3.orig/fs/xfs/Kconfig +++ linux-2.6.24-rc3/fs/xfs/Kconfig @@ -35,18 +35,6 @@ config XFS_QUOTA with or without the generic quota support enabled (CONFIG_QUOTA) - they are completely independent subsystems. -config XFS_SECURITY - bool "XFS Security Label support" - depends on XFS_FS - help - Security labels support alternative access control models - implemented by security modules like SELinux. This option - enables an extended attribute namespace for inode security - labels in the XFS filesystem. - - If you are not using a security module that requires using - extended attributes for inode security labels, say N. - config XFS_POSIX_ACL bool "XFS POSIX ACL support" depends on XFS_FS Index: linux-2.6.24-rc3/fs/xfs/linux-2.6/xfs_super.h =================================================================== --- linux-2.6.24-rc3.orig/fs/xfs/linux-2.6/xfs_super.h +++ linux-2.6.24-rc3/fs/xfs/linux-2.6/xfs_super.h @@ -50,13 +50,8 @@ extern void xfs_qm_exit(void); # define set_posix_acl_flag(sb) do { } while (0) #endif -#ifdef CONFIG_XFS_SECURITY -# define XFS_SECURITY_STRING "security attributes, " -# define ENOSECURITY 0 -#else -# define XFS_SECURITY_STRING -# define ENOSECURITY EOPNOTSUPP -#endif +/* Used to be "configurable" so keep it around. */ +#define XFS_SECURITY_STRING "security attributes, " #ifdef CONFIG_XFS_RT # define XFS_REALTIME_STRING "realtime, " Index: linux-2.6.24-rc3/fs/xfs/xfs_attr.c =================================================================== --- linux-2.6.24-rc3.orig/fs/xfs/xfs_attr.c +++ linux-2.6.24-rc3/fs/xfs/xfs_attr.c @@ -2651,7 +2651,7 @@ attr_secure_capable( bhv_vnode_t *vp, cred_t *cred) { - return -ENOSECURITY; + return 0; } STATIC int From owner-xfs@oss.sgi.com Sun Jan 6 20:38:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jan 2008 20:39:07 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130] (may be forged)) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m074cnem021042 for ; Sun, 6 Jan 2008 20:38:53 -0800 Received: from linuxbuild.melbourne.sgi.com (linuxbuild.melbourne.sgi.com [134.14.54.115]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA26729; Mon, 7 Jan 2008 15:38:35 +1100 From: donaldd@sgi.com Received: by linuxbuild.melbourne.sgi.com (Postfix, from userid 16365) id 9B272323C8EA; Mon, 7 Jan 2008 15:38:34 +1100 (EST) To: xfs@oss.sgi.com Cc: sgi.bugs.xfs@engr.sgi.com Subject: PARTIAL TAKE 971186 - dmapi: kill last 2.4 compat leftovers Message-Id: <20080107043834.9B272323C8EA@linuxbuild.melbourne.sgi.com> Date: Mon, 7 Jan 2008 15:38:34 +1100 (EST) X-Virus-Scanned: ClamAV 0.91.2/5400/Sun Jan 6 18:40:34 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14086 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 dmapi: kill last 2.4 compat leftovers Signed-off-by: Christoph Hellwig Date: Mon Jan 7 15:37:20 AEDT 2008 Workarea: linuxbuild.melbourne.sgi.com:/home/donaldd/isms/2.6.x-xfs Inspected by: hch@lst.de The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: linux-melb:dmapi:30299a fs/dmapi/dmapi_sysent.c - 1.40 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.6-xfs/fs/dmapi/dmapi_sysent.c.diff?r1=text&tr1=1.40&r2=text&tr2=1.39&f=h - kill last 2.4 compat leftovers fs/dmapi/dmapi_register.c - 1.52 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.6-xfs/fs/dmapi/dmapi_register.c.diff?r1=text&tr1=1.52&r2=text&tr2=1.51&f=h - kill last 2.4 compat leftovers From owner-xfs@oss.sgi.com Sun Jan 6 20:41:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jan 2008 20:41:44 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130] (may be forged)) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m074fUNv021362 for ; Sun, 6 Jan 2008 20:41:34 -0800 Received: from cxfsmac10.melbourne.sgi.com (cxfsmac10.melbourne.sgi.com [134.14.55.100]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA26818; Mon, 7 Jan 2008 15:41:15 +1100 Message-ID: <4781AD6A.2000007@sgi.com> Date: Mon, 07 Jan 2008 15:41:14 +1100 From: Donald Douwsma User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH] dmapi: kill last 2.4 compat leftovers References: <20071130093909.GB2949@lst.de> <20071221063703.GA23706@lst.de> In-Reply-To: <20071221063703.GA23706@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/5400/Sun Jan 6 18:40:34 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14087 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: donaldd@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > Any reason this didn't get in yet? No its in now, thanks for the reminder. Don > On Fri, Nov 30, 2007 at 10:39:09AM +0100, Christoph Hellwig wrote: >> Signed-off-by: Christoph Hellwig >> >> Index: linux-2.6-xfs/fs/dmapi/dmapi_register.c >> =================================================================== >> --- linux-2.6-xfs.orig/fs/dmapi/dmapi_register.c 2007-09-29 11:49:22.000000000 +0200 >> +++ linux-2.6-xfs/fs/dmapi/dmapi_register.c 2007-09-29 11:49:39.000000000 +0200 From owner-xfs@oss.sgi.com Sun Jan 6 23:11:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jan 2008 23:12:01 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m077BsrV022745 for ; Sun, 6 Jan 2008 23:11:56 -0800 X-ASG-Debug-ID: 1199689930-061c003b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from pentafluge.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 20F12C08B36 for ; Sun, 6 Jan 2008 23:12:10 -0800 (PST) Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by cuda.sgi.com with ESMTP id S7ASs8H6stBjDQoN for ; Sun, 06 Jan 2008 23:12:10 -0800 (PST) Received: from hch by pentafluge.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1JBm9Z-0007kb-5e; Mon, 07 Jan 2008 07:12:09 +0000 Date: Mon, 7 Jan 2008 07:12:09 +0000 From: Christoph Hellwig To: Eric Sandeen Cc: xfs-oss X-ASG-Orig-Subj: Re: [PATCH] remove CONFIG_XFS_SECURITY Subject: Re: [PATCH] remove CONFIG_XFS_SECURITY Message-ID: <20080107071208.GA29713@infradead.org> References: <47819E47.4030906@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47819E47.4030906@sandeen.net> User-Agent: Mutt/1.5.17 (2007-11-01) X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: pentafluge.infradead.org[213.146.154.40] X-Barracuda-Start-Time: 1199689931 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38818 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5403/Sun Jan 6 20:30:32 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14088 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Sun, Jan 06, 2008 at 09:36:39PM -0600, Eric Sandeen wrote: > Is there any point to this option? Sure, it disables the ability > to set security attributes at runtime, but it doesn't slim down > any code. > > Any reason to not remove it, and always allow security attributes > to be set? I suspect the reason it is there currently is because the other filesystems have similar option. Removing it sounds perfectly fine to me. From owner-xfs@oss.sgi.com Mon Jan 7 12:27:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jan 2008 12:27:51 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m07KRjlO029509 for ; Mon, 7 Jan 2008 12:27:47 -0800 X-ASG-Debug-ID: 1199737681-292602d80000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wa-out-1112.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A1CAB4F1CB5 for ; Mon, 7 Jan 2008 12:28:01 -0800 (PST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.181]) by cuda.sgi.com with ESMTP id kGitqY8lvbGDZehx for ; Mon, 07 Jan 2008 12:28:01 -0800 (PST) Received: by wa-out-1112.google.com with SMTP id k22so13565651waf.18 for ; Mon, 07 Jan 2008 12:28:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=HqPw7n4PdRLEWPEhtDSckYorIq1ww9tLAmYR/xbqRdY=; b=dZ7Df1jz2JjDUg7vDGYSvjlvu9tqgBmmJoWX3YABZklOWq+LkWGh1F0YoNiMP3dmfa3ZttZT5nnTtVCk1ZaWU02OzrgJ0lox9tSRHQt5C/1sm3psLALjgOdDDOpnwxz2CeZGt2gA6o/KyrW5S/f4kOHxDVx/Z4l7fZFW/O8G0tc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Kco3wGpagmkJl6+mllHki7+536GM2u0sgoDrfZH0BQpIRabkFVI8+aqptU+UYH7SEgRqC7holJ/YnWaeZJklvCAsgLN/x0XgpdMF25c1W7tbASo3KlLAMr/cnqCeMcPFEYgkWl0VgUdIVyG+nE5T1o8cQRvMqA4KB3+XijK57Is= Received: by 10.114.190.6 with SMTP id n6mr22739325waf.51.1199737679967; Mon, 07 Jan 2008 12:27:59 -0800 (PST) Received: by 10.114.255.19 with HTTP; Mon, 7 Jan 2008 12:27:59 -0800 (PST) Message-ID: <5d96567b0801071227i509402ccuce044106cc8959af@mail.gmail.com> Date: Mon, 7 Jan 2008 22:27:59 +0200 From: Raz To: linux-xfs@oss.sgi.com X-ASG-Orig-Subj: mount option swalloc Subject: mount option swalloc MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Barracuda-Connect: wa-out-1112.google.com[209.85.146.181] X-Barracuda-Start-Time: 1199737681 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38870 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5420/Mon Jan 7 06:34:42 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14089 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 Does it work ? I have created several 100MBytes files over raid5 and they don't seem to be starting at modulo (swidth ) = 0. conf: sunit=1M , raid5 with 4 sata disks. swidth=3MB. meta-data=/dev/md1 isize=256 agcount=32, agsize=5687296 blks = sectsz=4096 attr=0 data = bsize=4096 blocks=181989888, imaxpct=25 = sunit=256 swidth=768 blks, unwritten=1 naming =version 2 bsize=4096 log =internal bsize=4096 blocks=32768, version=2 = sectsz=4096 sunit=1 blks realtime =none extsz=3145728 blocks=0, rtextents=0 I am using 2.6.17 vanilla kernel . thank you -- Raz From owner-xfs@oss.sgi.com Mon Jan 7 14:53:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jan 2008 14:53:56 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m07MrnAB010479 for ; Mon, 7 Jan 2008 14:53:52 -0800 X-ASG-Debug-ID: 1199746444-16fe00550000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 091D14F29E2 for ; Mon, 7 Jan 2008 14:54:05 -0800 (PST) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id bwrRLTP9HuGcd2fo for ; Mon, 07 Jan 2008 14:54:05 -0800 (PST) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m07MrvF3024427 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 7 Jan 2008 23:53:57 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m07MrvMT024425 for xfs@oss.sgi.com; Mon, 7 Jan 2008 23:53:57 +0100 Date: Mon, 7 Jan 2008 23:53:57 +0100 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] xfs: fix unaligned access in readdir Subject: Re: [PATCH] xfs: fix unaligned access in readdir Message-ID: <20080107225357.GA24361@lst.de> References: <20071226154857.GA3472@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071226154857.GA3472@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1199746446 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38880 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5421/Mon Jan 7 12:23:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14090 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Wed, Dec 26, 2007 at 04:48:57PM +0100, Christoph Hellwig wrote: > This patch should fix the issue seen on Alpha with unaligned accesses > in the new readdir code. By aligning each dirent to sizeof(u64) we'll > avoid unaligned accesses. To make doubly sure we're not hitting > problems also rearrange struct hack_dirent to avoid holes. If anyone in Melbourne is getting back from Holidays it would be nice if we could get this patch into 2.6.24-final still.. From owner-xfs@oss.sgi.com Mon Jan 7 20:34:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jan 2008 20:34:56 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m084YPqb012563 for ; Mon, 7 Jan 2008 20:34:29 -0800 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA05295; Tue, 8 Jan 2008 15:34:36 +1100 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 8676858C4C0F; Tue, 8 Jan 2008 15:34:36 +1100 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 975411 - fix unaligned access in readdir Message-Id: <20080108043436.8676858C4C0F@chook.melbourne.sgi.com> Date: Tue, 8 Jan 2008 15:34:36 +1100 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/5428/Mon Jan 7 18:45:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14091 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs fix unaligned access in readdir This patch should fix the issue seen on Alpha with unaligned accesses in the new readdir code. By aligning each dirent to sizeof(u64) we'll avoid unaligned accesses. To make doubly sure we're not hitting problems also rearrange struct hack_dirent to avoid holes. Signed-off-by: Christoph Hellwig Date: Tue Jan 8 15:33:20 AEDT 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-readdir Inspected by: Christoph Hellwig 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:30302a fs/xfs/linux-2.6/xfs_file.c - 1.162 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_file.c.diff?r1=text&tr1=1.162&r2=text&tr2=1.161&f=h - fix unaligned access in readdir From owner-xfs@oss.sgi.com Mon Jan 7 20:41:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jan 2008 20:41:06 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m084exIf013249 for ; Mon, 7 Jan 2008 20:41:01 -0800 Received: from linuxbuild.melbourne.sgi.com (linuxbuild.melbourne.sgi.com [134.14.54.115]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA05452; Tue, 8 Jan 2008 15:41:12 +1100 From: donaldd@sgi.com Received: by linuxbuild.melbourne.sgi.com (Postfix, from userid 16365) id B6C9B323B2C0; Tue, 8 Jan 2008 15:41:11 +1100 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: PARTIAL TAKE 970982 - Remove empty, duplicate, kdb headers. Message-Id: <20080108044111.B6C9B323B2C0@linuxbuild.melbourne.sgi.com> Date: Tue, 8 Jan 2008 15:41:11 +1100 (EST) X-Virus-Scanned: ClamAV 0.91.2/5428/Mon Jan 7 18:45:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14092 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 Date: Tue Jan 8 15:36:56 AEDT 2008 Workarea: linuxbuild.melbourne.sgi.com:/home/donaldd/isms/2.6.x-xfs Inspected by: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: 2.6.x-xfs-melb:linux:30304a include/kdbprivate.h - 1.2 - deleted http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.6-xfs/include/kdbprivate.h.diff?r1=text&tr1=1.2&r2=text&tr2=1.1&f=h include/kdb.h - 1.2 - deleted http://oss.sgi.com/cgi-bin/cvsweb.cgi/linux-2.6-xfs/include/kdb.h.diff?r1=text&tr1=1.2&r2=text&tr2=1.1&f=h - Remove empty, duplicate, kdb headers. From owner-xfs@oss.sgi.com Tue Jan 8 01:32:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jan 2008 01:33:02 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m089Wlss011999 for ; Tue, 8 Jan 2008 01:32:50 -0800 X-ASG-Debug-ID: 1199784782-1ebd018f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ug-out-1314.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A9A6CC25D2E for ; Tue, 8 Jan 2008 01:33:03 -0800 (PST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.174]) by cuda.sgi.com with ESMTP id Fcb660kOoiwZsDO5 for ; Tue, 08 Jan 2008 01:33:03 -0800 (PST) Received: by ug-out-1314.google.com with SMTP id o29so3671041ugd.20 for ; Tue, 08 Jan 2008 01:33:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=BU3YZy6H4gaLwxeXbymbvlfzJYYdBbucTJClcT/PkoQ=; b=b35yHJlkno14S+CrI23/OPHtd2Q8gklJYHw04IoGD20AsriUtm0aCk/XhYwbETQjxs3J5ALmfOtD1xW2kG9yC3j+b0/X/RWN6abpL1ESvrNfLtks7HuLqNabk/zy497TCJAAnX8jAbp8tGBqZPD58wsWTjNP7CyWLUKdPQEp/UQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=yDQwCDIRsVA28g8szLKXv+PIsREwKKzBtkbtsn2BdEaEvn4OvkNAIr5p5w4LBjqyJ8rqzgNLoeJ/eSCkuju0OJPqmsBln0ggPFfG0uWn7hW3VgXdUa2b4rnwXgW6+TSPK4sF4yGn+vTlDywkuWFNAE5PpK625IvV+TrPoPSV6Uk= Received: by 10.66.252.18 with SMTP id z18mr805091ugh.37.1199783107654; Tue, 08 Jan 2008 01:05:07 -0800 (PST) Received: by 10.66.242.18 with HTTP; Tue, 8 Jan 2008 01:05:07 -0800 (PST) Message-ID: <96c268400801080105h68a75233ia82e05d8debaabe6@mail.gmail.com> Date: Tue, 8 Jan 2008 12:05:07 +0300 From: "Maxim Gordienko" To: "Barry Naujok" X-ASG-Orig-Subj: Re: xfs_repair core dump Subject: Re: xfs_repair core dump Cc: xfs@oss.sgi.com In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <96c268400801061801i62853e5xdda1b93cc864dda5@mail.gmail.com> X-Barracuda-Connect: ug-out-1314.google.com[66.249.92.174] X-Barracuda-Start-Time: 1199784783 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38921 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5429/Tue Jan 8 01:00:19 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14093 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: mgordienko@gmail.com Precedence: bulk X-list: xfs On Jan 8, 2008 7:21 AM, Barry Naujok wrote: > On Mon, 07 Jan 2008 13:01:00 +1100, Maxim Gordienko > wrote: > > > Hello! > > > > I'm trying to repair damaged xfs partition, but xfs_repair crashes > > with core dump > > distribution is fully updated ubuntu 7.10, xfsprogs are 2.9.0. > > Have tried xfs_repair from other dists like knoppix or gparted livecd, > > compiled from source last stable (2.9.4-1) > > same result. Could you please help? Thank you. > > Would it be possible to obtain an image or metadump image of your > filesystem so I can diagnose the xfs_repair problem here? > > xfs_metadump obfuscates most filenames if privacy is an issue. > I shared metadump at https://mastubuntu.dyndns.org/xfs.dump.bz2 sorry, partition is 175gb big, i cannot create full dump. > Regards, > Barry. > > > > Phase 5 - rebuild AG headers and trees... > > *** glibc detected *** xfs_repair: munmap_chunk(): invalid pointer: > > 0xb514d008 *** > > ======= Backtrace: ========= > > /lib/tls/i686/cmov/libc.so.6(cfree+0x1bb)[0xb7ead92b] > > xfs_repair[0x8062d9a] > > xfs_repair[0x806c896] > > xfs_repair[0x8080515] > > /lib/tls/i686/cmov/libpthread.so.0[0xb7f9846b] > > /lib/tls/i686/cmov/libc.so.6(clone+0x5e)[0xb7f136de] > > > > > > > From owner-xfs@oss.sgi.com Tue Jan 8 02:50:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jan 2008 02:50:08 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m08Ao0I7017793 for ; Tue, 8 Jan 2008 02:50:03 -0800 X-ASG-Debug-ID: 1199789416-1ebd022f0000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5FCE911A05EF for ; Tue, 8 Jan 2008 02:50:17 -0800 (PST) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id QhxOgjn036HylD8N for ; Tue, 08 Jan 2008 02:50:17 -0800 (PST) Received: by lucidpixels.com (Postfix, from userid 1001) id 695001C00023F; Tue, 8 Jan 2008 05:50:16 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by lucidpixels.com (Postfix) with ESMTP id 5B0A74019348; Tue, 8 Jan 2008 05:50:16 -0500 (EST) Date: Tue, 8 Jan 2008 05:50:16 -0500 (EST) From: Justin Piszcz X-X-Sender: jpiszcz@p34.internal.lan To: Raz cc: linux-xfs@oss.sgi.com X-ASG-Orig-Subj: Re: mount option swalloc Subject: Re: mount option swalloc In-Reply-To: <5d96567b0801071227i509402ccuce044106cc8959af@mail.gmail.com> Message-ID: References: <5d96567b0801071227i509402ccuce044106cc8959af@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1199789417 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38927 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5429/Tue Jan 8 01:00:19 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14094 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs Isn't 2.6.17 - 2.6.17.6 the bugged version of the kernel that corrupts XFS filesystems? I suggest you run a different kernel version and xfs_repair on your XFS filesystems. Justin. On Mon, 7 Jan 2008, Raz wrote: > Does it work ? > I have created several 100MBytes files over raid5 and they don't seem > to be starting at modulo (swidth ) = 0. > conf: sunit=1M , raid5 with 4 sata disks. swidth=3MB. > > meta-data=/dev/md1 isize=256 agcount=32, agsize=5687296 blks > = sectsz=4096 attr=0 > data = bsize=4096 blocks=181989888, imaxpct=25 > = sunit=256 swidth=768 blks, unwritten=1 > naming =version 2 bsize=4096 > log =internal bsize=4096 blocks=32768, version=2 > = sectsz=4096 sunit=1 blks > realtime =none extsz=3145728 blocks=0, rtextents=0 > > I am using 2.6.17 vanilla kernel . > > thank you > -- > Raz > > From owner-xfs@oss.sgi.com Tue Jan 8 06:07:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jan 2008 06:07:05 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_40,UNPARSEABLE_RELAY autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m08E6v4M006674 for ; Tue, 8 Jan 2008 06:07:00 -0800 X-ASG-Debug-ID: 1199801230-3dc300350000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp-out5.blueyonder.co.uk (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4D829C25FA2 for ; Tue, 8 Jan 2008 06:07:10 -0800 (PST) Received: from smtp-out5.blueyonder.co.uk (smtp-out5.blueyonder.co.uk [195.188.213.8]) by cuda.sgi.com with ESMTP id 4ScVJI4l1BrngISM for ; Tue, 08 Jan 2008 06:07:10 -0800 (PST) Received: from [172.23.170.139] (helo=anti-virus01-10) by smtp-out5.blueyonder.co.uk with smtp (Exim 4.52) id 1JCEx0-0002W0-Vl for xfs@oss.sgi.com; Tue, 08 Jan 2008 13:57:07 +0000 Received: from [195.188.53.233] (helo=webmail.blueyonder.co.uk) by asmtp-out3.blueyonder.co.uk with esmtp (Exim 4.52) id 1JCEx0-0001h6-Il for xfs@oss.sgi.com; Tue, 08 Jan 2008 13:57:06 +0000 Received: from 82.45.191.179 (SquirrelMail authenticated user); by webmail.blueyonder.co.uk with HTTP; Tue, 8 Jan 2008 13:57:06 -0000 (GMT) Message-ID: <59227.82.45.191.179.1199800626.SVkUQ21ZSE16Sg==.squirrel@82.45.191.179> Date: Tue, 8 Jan 2008 13:57:06 -0000 (GMT) X-ASG-Orig-Subj: xfs creation options - raid Subject: xfs creation options - raid From: carpcatcher@blueyonder.co.uk To: xfs@oss.sgi.com User-Agent: SquirrelMail/1.4.3a X-Mailer: SquirrelMail/1.4.3a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Barracuda-Connect: smtp-out5.blueyonder.co.uk[195.188.213.8] X-Barracuda-Start-Time: 1199801234 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.47 X-Barracuda-Spam-Status: No, SCORE=-1.47 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=NO_REAL_NAME, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.38941 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.55 NO_REAL_NAME From: does not include a real name 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-Virus-Scanned: ClamAV 0.91.2/5432/Tue Jan 8 04:57:41 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14095 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: carpcatcher@blueyonder.co.uk Precedence: bulk X-list: xfs Hello, been reading documents but still not sure what are best option to use when creating xfs on my raid system. Raid card details below. I have 2 raid 1 arrays which will have xfs partitions: Array 1 55gb with 1 40gb xfs partition for /home Array set as stripe 64kb block 512 bytes Array 2 645gb 1 xfs partition using all space for file storage Array set as stripe 128kb block 512 bytes I have been looking at docs and come with following to create FS on 645gb xfs partition. mkfs.xfs -f -d agcount=42 -l size=64m /dev/sde5 The default agcount= was 32 but am not 100% sure how to work this out for correct number? I would mount with following options: mount -o logbufs=8,noatime,nodiratime The other setting am not sure how to get right is this bit from docs: "XFS allows you to select the stripe unit for a RAID device or stripe volume." Now i know i need to set -d su= -d sw= but best to work this out for my arrays? The 645gb array/partition will be used for files 3mb to 250mb with most being about 20/30mb Raid is Areca 1210 raid controller: Adapter Architecture ARC-1210 uses IntelR IOP332 I/O processor. ARC-1220/1230/1260 uses IntelR IOP333 I/O processor PCI-Express X8 bus 256MB on-board DDR333 SDRAM with ECC protection(4/8-port) One SODIMM socket with default 256MB of DDR333 SDRAM with ECC protection, Upgrade to 1GB. An ECC or non-ECC SDRAM module using X8 or X16 chip organization (12/16/24-port) Write-through or write-back cache From owner-xfs@oss.sgi.com Wed Jan 9 15:00:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jan 2008 15:00:10 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m09N02gR023263 for ; Wed, 9 Jan 2008 15:00:04 -0800 X-ASG-Debug-ID: 1199919618-7a7c01050000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ext.agami.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B99AC50135F for ; Wed, 9 Jan 2008 15:00:18 -0800 (PST) Received: from ext.agami.com (64.221.212.177.ptr.us.xo.net [64.221.212.177]) by cuda.sgi.com with ESMTP id CYYQYjNbJl0bYtmF for ; Wed, 09 Jan 2008 15:00:18 -0800 (PST) Received: from agami.com (mail [192.168.168.5]) by ext.agami.com (8.12.5/8.12.5) with ESMTP id m09MxsWb016314 for ; Wed, 9 Jan 2008 14:59:54 -0800 Received: from mx1.agami.com (mx1.agami.com [10.123.10.30]) by agami.com (8.12.11/8.12.11) with ESMTP id m09MxnJ1016417 for ; Wed, 9 Jan 2008 14:59:49 -0800 Received: from [10.123.4.142] ([10.123.4.142]) by mx1.agami.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 9 Jan 2008 15:00:12 -0800 Message-ID: <478551FC.3040909@agami.com> Date: Wed, 09 Jan 2008 15:00:12 -0800 From: Michael Nishimoto User-Agent: Mail/News 1.5.0.4 (X11/20060629) MIME-Version: 1.0 To: XFS Mailing List X-ASG-Orig-Subj: CVS access down? Subject: CVS access down? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 09 Jan 2008 23:00:12.0373 (UTC) FILETIME=[63CA1050:01C85313] X-Scanned-By: MIMEDefang 2.58 on 192.168.168.13 X-Barracuda-Connect: 64.221.212.177.ptr.us.xo.net[64.221.212.177] X-Barracuda-Start-Time: 1199919619 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0094 1.0000 -1.9599 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.96 X-Barracuda-Spam-Status: No, SCORE=-1.96 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39072 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5459/Wed Jan 9 08:00:29 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14096 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: miken@agami.com Precedence: bulk X-list: xfs It appears that CVS access is down. Can someone please take a look to see what's broken? Thanks! From owner-xfs@oss.sgi.com Wed Jan 9 20:55:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jan 2008 20:56:01 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0A4tpjw001576 for ; Wed, 9 Jan 2008 20:55:55 -0800 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA21513; Thu, 10 Jan 2008 15:56:03 +1100 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id A61C458C4C0F; Thu, 10 Jan 2008 15:56:03 +1100 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 974151 - prevent panic during log recovery due to bogus operation header length Message-Id: <20080110045603.A61C458C4C0F@chook.melbourne.sgi.com> Date: Thu, 10 Jan 2008 15:56:03 +1100 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/5462/Wed Jan 9 18:48:40 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14097 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs prevent panic during log recovery due to bogus operation header length A problem was reported where a system panicked in log recovery due to a corrupt log record. The cause of the corruption is not known but this change will at least prevent a crash for this specific scenario. Log recovery definitely needs some more work in this area. Date: Thu Jan 10 15:54:49 AEDT 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-free Inspected by: dgc hch@infradead.org Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:30318a fs/xfs/xfs_log_recover.c - 1.333 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log_recover.c.diff?r1=text&tr1=1.333&r2=text&tr2=1.332&f=h - prevent panic during log recovery due to bogus operation header length From owner-xfs@oss.sgi.com Wed Jan 9 23:19:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jan 2008 23:20:16 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_45 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0A7JmGx018064 for ; Wed, 9 Jan 2008 23:19:49 -0800 X-ASG-Debug-ID: 1199949601-3e2b00380000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ug-out-1314.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 16DD6502CEF for ; Wed, 9 Jan 2008 23:20:02 -0800 (PST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.172]) by cuda.sgi.com with ESMTP id s81zRQvzVH4ifvcH for ; Wed, 09 Jan 2008 23:20:02 -0800 (PST) Received: by ug-out-1314.google.com with SMTP id o29so209182ugd.20 for ; Wed, 09 Jan 2008 23:20:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=AOK4e24SIFatYIQzCF3BPNeOzFynzxB8Dba630YXjFI=; b=b7qix53xvNwELvCj6qfaECYkEbJpEbcQPasSNrq6sRTBegfyPsp0XYtT2lP9Td5JdZqqXe+2fsq8gSeBCBsAxE/cJoX+dVjD9COKVU1kC/t1yZ+g47KipV25HnkMqM5RbXqfi5nfeehzDWiS2OsJfi2dHNmXSYblG4444IZEA0A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ruqlJSOLj/7N5RsyClllIkOU8CVK8Owq8ReFDShMQDM5vwPWkdFddo2kIhcjAZNg9wzEXFa8Av9MG+5iQaMZntRhuC1RZEol4Dl5vMXaQmQAvi7Vhnp41yJMsHOGP6MY9mzTDB/X2aaaGJqB6l3V9ffr0QAUoCCYMEas1znjwBE= Received: by 10.67.116.11 with SMTP id t11mr3189584ugm.61.1199949600972; Wed, 09 Jan 2008 23:20:00 -0800 (PST) Received: by 10.66.242.18 with HTTP; Wed, 9 Jan 2008 23:20:00 -0800 (PST) Message-ID: <96c268400801092320i70a4f0d4i70050aad4b6125b2@mail.gmail.com> Date: Thu, 10 Jan 2008 10:20:00 +0300 From: "Maxim Gordienko" To: "Barry Naujok" X-ASG-Orig-Subj: Re: xfs_repair core dump Subject: Re: xfs_repair core dump Cc: xfs@oss.sgi.com In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <96c268400801061801i62853e5xdda1b93cc864dda5@mail.gmail.com> <96c268400801080105h68a75233ia82e05d8debaabe6@mail.gmail.com> X-Barracuda-Connect: ug-out-1314.google.com[66.249.92.172] X-Barracuda-Start-Time: 1199949605 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39106 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5464/Wed Jan 9 19:16:47 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14098 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: mgordienko@gmail.com Precedence: bulk X-list: xfs On Jan 10, 2008 6:58 AM, Barry Naujok wrote: > On Tue, 08 Jan 2008 20:05:07 +1100, Maxim Gordienko > wrote: > > > On Jan 8, 2008 7:21 AM, Barry Naujok wrote: > >> On Mon, 07 Jan 2008 13:01:00 +1100, Maxim Gordienko > >> > >> wrote: > >> > >> > Hello! > >> > > >> > I'm trying to repair damaged xfs partition, but xfs_repair crashes > >> > with core dump > >> > distribution is fully updated ubuntu 7.10, xfsprogs are 2.9.0. > >> > Have tried xfs_repair from other dists like knoppix or gparted livecd, > >> > compiled from source last stable (2.9.4-1) > >> > same result. Could you please help? Thank you. > > Ok, I think I have it! > > Can you try the attached patch to 2.9.4 source. It should "repair" your > disk. There are a lot of inodes that have problems and quite a few > will end up in lost+found. > > Regards, > Barry. Thank you Barry! works like a charm! about 5k files end up in lost+found, long way to recover them. Hope to see this patch in next release of xfsprogs (actually, hope never use xfs_repair again) Thank you again! From owner-xfs@oss.sgi.com Thu Jan 10 18:29:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jan 2008 18:29:36 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00, T_STOX_BOUND_090909_B autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0B2TTp0020326 for ; Thu, 10 Jan 2008 18:29:30 -0800 X-ASG-Debug-ID: 1200018583-4ca1003f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from slurp.thebarn.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 94E6E50A24C for ; Thu, 10 Jan 2008 18:29:43 -0800 (PST) Received: from slurp.thebarn.com (cattelan-host202.dsl.visi.com [208.42.117.202]) by cuda.sgi.com with ESMTP id fw4JyMqW9d0EmVps for ; Thu, 10 Jan 2008 18:29:43 -0800 (PST) Received: from [127.0.0.1] (slurp.thebarn.com [208.42.117.201]) (authenticated bits=0) by slurp.thebarn.com (8.14.0/8.13.8) with ESMTP id m0B2ONEs038961 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 10 Jan 2008 20:24:27 -0600 (CST) (envelope-from cattelan@thebarn.com) Message-ID: <4786D35C.9030104@thebarn.com> Date: Thu, 10 Jan 2008 20:24:28 -0600 From: Russell Cattelan User-Agent: Thunderbird 2.0.0.9 (X11/20071227) MIME-Version: 1.0 To: Michael Nishimoto CC: XFS Mailing List X-ASG-Orig-Subj: Re: CVS access down? Subject: Re: CVS access down? References: <478551FC.3040909@agami.com> In-Reply-To: <478551FC.3040909@agami.com> Content-Type: multipart/mixed; boundary="------------080102060705030408080809" X-Virus-Scanned: ClamAV 0.91.2/5473/Thu Jan 10 15:56:40 2008 on oss.sgi.com X-Virus-Scanned: ClamAV 0.91.2/5473/Thu Jan 10 17:56:40 2008 on slurp.thebarn.com X-Virus-Status: Clean X-Barracuda-Connect: cattelan-host202.dsl.visi.com[208.42.117.202] X-Barracuda-Start-Time: 1200018586 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39182 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 14099 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: cattelan@thebarn.com Precedence: bulk X-list: xfs This is a multi-part message in MIME format. --------------080102060705030408080809 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Michael Nishimoto wrote: > It appears that CVS access is down. Can someone please take > a look to see what's broken? > > Thanks! > Anymore info? I just did quick test cvs -d :pserver:cvs@oss.sgi.com:/cvs co xfs-cmds seems to be working fine for me. -Russell --------------080102060705030408080809 Content-Type: text/x-vcard; charset=utf-8; name="cattelan.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cattelan.vcf" begin:vcard fn:Russell Cattelan n:Cattelan;Russell email;internet:cattelan@thebarn.com x-mozilla-html:FALSE version:2.1 end:vcard --------------080102060705030408080809-- From owner-xfs@oss.sgi.com Thu Jan 10 23:07:32 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jan 2008 23:07:36 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0B77RKO026384 for ; Thu, 10 Jan 2008 23:07:31 -0800 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA29899; Fri, 11 Jan 2008 18:07:37 +1100 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 115D758C4C0F; Fri, 11 Jan 2008 18:07:36 +1100 (EST) Date: Fri, 11 Jan 2008 18:07:36 +1100 To: torvalds@linux-foundation.org Cc: linux-kernel@vger.kernel.org, xfs@oss.sgi.com, akpm@linux-foundation.org Subject: [GIT PULL] XFS update for 2.6.24-rc8 User-Agent: nail 11.25 7/29/05 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20080111070737.115D758C4C0F@chook.melbourne.sgi.com> From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/5473/Thu Jan 10 15:56:40 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14100 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Please pull from the for-linus branch: git pull git://oss.sgi.com:8090/xfs/xfs-2.6.git for-linus This will update the following files: fs/xfs/linux-2.6/xfs_file.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) through these commits: commit aea6ad0ce5e215ce99fe9e3edd9268f696862d8f Author: Christoph Hellwig Date: Thu Jan 10 16:43:26 2008 +1100 [XFS] fix unaligned access in readdir This patch should fix the issue seen on Alpha with unaligned accesses in the new readdir code. By aligning each dirent to sizeof(u64) we'll avoid unaligned accesses. To make doubly sure we're not hitting problems also rearrange struct hack_dirent to avoid holes. SGI-PV: 975411 SGI-Modid: xfs-linux-melb:xfs-kern:30302a Signed-off-by: Christoph Hellwig Signed-off-by: Lachlan McIlroy From owner-xfs@oss.sgi.com Fri Jan 11 09:07:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 11 Jan 2008 09:08:30 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,BigEvilList_RX, URI_HEX autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0BH7oTH003414 for ; Fri, 11 Jan 2008 09:07:52 -0800 X-ASG-Debug-ID: 1200071284-4063031c0000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bounce.jcnet.ad.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4C7E711B8E8C for ; Fri, 11 Jan 2008 09:08:05 -0800 (PST) Received: from bounce.jcnet.ad.jp (bounce.jcnet.ad.jp [218.219.80.234]) by cuda.sgi.com with ESMTP id 4QSrOks9t3PAmZHK for ; Fri, 11 Jan 2008 09:08:05 -0800 (PST) Received: from smtp.jcnet.ad.jp (localhost [127.0.0.1]) by bounce.jcnet.ad.jp (Postfix) with ESMTP id 443CA2E6CF7 for ; Sat, 12 Jan 2008 02:08:03 +0900 (JST) Received: from mg01vsv.sv.jcnet.ad.jp (mailservers [10.1.0.99]) by smtp.jcnet.ad.jp (Postfix) with ESMTP id 3912BC3CC8 for ; Sat, 12 Jan 2008 02:08:03 +0900 (JST) Received: from localhost (localhost) by mg01vsv.sv.jcnet.ad.jp (MOS 3.7.3a-GA) with internal id CVQ00834; Sat, 12 Jan 2008 02:07:51 +0900 (JST) Date: Sat, 12 Jan 2008 02:07:51 +0900 (JST) From: Mail Delivery Subsystem Message-Id: <200801111707.CVQ00834@mg01vsv.sv.jcnet.ad.jp> To: linux-xfs@oss.sgi.com MIME-Version: 1.0 Content-Type: multipart/report; report-type=delivery-status; boundary="CVQ00834.1200071271/mg01vsv.sv.jcnet.ad.jp" X-ASG-Orig-Subj: Returned mail: Recipient address rejected: User unknown in relay recipient table (from [10.1.0.189]) Subject: Returned mail: Recipient address rejected: User unknown in relay recipient table (from [10.1.0.189]) Auto-Submitted: auto-generated (failure) X-Barracuda-Connect: bounce.jcnet.ad.jp[218.219.80.234] X-Barracuda-Start-Time: 1200071288 X-Barracuda-Bayes: INNOCENT GLOBAL 0.3725 1.0000 -0.0777 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.08 X-Barracuda-Spam-Status: No, SCORE=-0.08 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39241 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5477/Fri Jan 11 04:26:19 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14101 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: MAILER-DAEMON@mg01vsv.sv.jcnet.ad.jp Precedence: bulk X-list: xfs This is a MIME-encapsulated message --CVQ00834.1200071271/mg01vsv.sv.jcnet.ad.jp The original message was received at Sat, 12 Jan 2008 02:07:40 +0900 (JST) from 222100.unitednetworx.com [87.121.18.100] (may be forged) ----- The following addresses had permanent delivery errors ----- --CVQ00834.1200071271/mg01vsv.sv.jcnet.ad.jp Content-Type: message/delivery-status Reporting-MTA: dns; mg01vsv.sv.jcnet.ad.jp Arrival-Date: Sat, 12 Jan 2008 02:07:40 +0900 (JST) Final-Recipient: RFC822; linuxx@c3-net.ne.jp Action: failed Status: 5.1.1 Remote-MTA: DNS; [10.1.0.189] Diagnostic-Code: SMTP; 550 5.1.1 : Recipient address rejected: User unknown in relay recipient table Last-Attempt-Date: Sat, 12 Jan 2008 02:07:51 +0900 (JST) --CVQ00834.1200071271/mg01vsv.sv.jcnet.ad.jp Content-Type: message/rfc822 Return-Path: Received: from n-force (222100.unitednetworx.com [87.121.18.100] (may be forged)) by mg01vsv.sv.jcnet.ad.jp (MOS 3.7.3a-GA) with SMTP id CVQ00699; Sat, 12 Jan 2008 02:07:39 +0900 (JST) Date: Sat, 12 Jan 2008 02:07:38 +0900 (JST) X-Originating-IP: [17.6.47.99] X-Originating-Email: [linuxx@c3-net.ne.jp] X-Sender: linuxx@c3-net.ne.jp Received: (qmail 2953 by uid 477); Fri, 11 Jan 2008 07:08:30 +0200 Message-Id: <20080111090830.2955.qmail@n-force> To: Subject: SALE 74% OFF on Pfizer From: "admin@Viagra.com" --CVQ00834.1200071271/mg01vsv.sv.jcnet.ad.jp-- From owner-xfs@oss.sgi.com Fri Jan 11 09:19:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 11 Jan 2008 09:19:28 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_50 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0BHJNa0005076 for ; Fri, 11 Jan 2008 09:19:25 -0800 X-ASG-Debug-ID: 1200071978-135e01630000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from fipprd08.prodigy.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6ED6D11B9334 for ; Fri, 11 Jan 2008 09:19:38 -0800 (PST) Received: from fipprd08.prodigy.net (fipprd08.sbcis.sbc.com [207.115.20.91]) by cuda.sgi.com with ESMTP id nYIHT3i8rEVjZ78S for ; Fri, 11 Jan 2008 09:19:38 -0800 (PST) Received: (from root@localhost) by fipprd08.prodigy.net (8.13.6 out.dk/8.13.6) id m0BHJbHT058972 for xfs@oss.sgi.com; Fri, 11 Jan 2008 09:19:37 -0800 From: MAILER-DAEMON@prodigy.net Message-Id: <200801111719.m0BHJbHT058972@fipprd08.prodigy.net> Date: Fri, 11 Jan 2008 09:19:35 -0800 X-ASG-Orig-Subj: Returned mail: Report Subject: Returned mail: Report To: X-Barracuda-Connect: fipprd08.sbcis.sbc.com[207.115.20.91] X-Barracuda-Start-Time: 1200071981 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4992 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.83 X-Barracuda-Spam-Status: No, SCORE=0.83 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=MAILTO_TO_SPAM_ADDR, NO_REAL_NAME X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39241 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.55 NO_REAL_NAME From: does not include a real name 0.28 MAILTO_TO_SPAM_ADDR URI: Includes a link to a likely spammer email X-Virus-Scanned: ClamAV 0.91.2/5478/Fri Jan 11 07:39:22 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14102 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: MAILER-DAEMON@prodigy.net Precedence: bulk X-list: xfs User's mailbox is full: Unable to deliver mail. From owner-xfs@oss.sgi.com Fri Jan 11 12:58:01 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 11 Jan 2008 12:58:06 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_50 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0BKvxiA024717 for ; Fri, 11 Jan 2008 12:58:01 -0800 X-ASG-Debug-ID: 1200085093-468703700000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from jackfruit.srv.cs.cmu.edu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0C77050EA3F for ; Fri, 11 Jan 2008 12:58:13 -0800 (PST) Received: from jackfruit.srv.cs.cmu.edu (JACKFRUIT.SRV.CS.CMU.EDU [128.2.201.16]) by cuda.sgi.com with ESMTP id Pg28eMC534BJSWAw for ; Fri, 11 Jan 2008 12:58:13 -0800 (PST) Received: from loganberry.srv.cs.cmu.edu (LOGANBERRY.SRV.CS.CMU.EDU [128.2.222.194]) by jackfruit.srv.cs.cmu.edu (8.13.6/8.13.6) with ESMTP id m0BGhin9014107 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 11 Jan 2008 11:43:44 -0500 (EST) Received: from LOGANBERRY.SRV.CS.CMU.EDU (localhost [127.0.0.1]) by loganberry.srv.cs.cmu.edu (8.13.6/8.13.6) with ESMTP id m0BGhiWj022220 for ; Fri, 11 Jan 2008 11:43:44 -0500 (EST) X-ASG-Orig-Subj: [PMX:VIRUS] Returned mail: see transcript for details Subject: [PMX:VIRUS] Returned mail: see transcript for details From: connectionists-owner@cs.cmu.edu To: xfs@oss.sgi.com MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0431357774==" Message-ID: Date: Fri, 11 Jan 2008 09:38:42 -0500 Precedence: bulk X-BeenThere: connectionists@cs.cmu.edu X-Mailman-Version: 2.1.6 X-Barracuda-Connect: JACKFRUIT.SRV.CS.CMU.EDU[128.2.201.16] X-Barracuda-Start-Time: 1200085097 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0017 1.0000 -2.0099 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.96 X-Barracuda-Spam-Status: No, SCORE=-0.96 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=BSF_RULE7568M, NO_REAL_NAME X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39256 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.55 NO_REAL_NAME From: does not include a real name 0.50 BSF_RULE7568M BODY: Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/5478/Fri Jan 11 07:39:22 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14103 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: connectionists-owner@cs.cmu.edu Precedence: bulk X-list: xfs --===============0431357774== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit You are not allowed to post to this mailing list, and your message has been automatically rejected. If you think that your messages are being rejected in error, contact the mailing list owner at connectionists-owner@cs.cmu.edu. --===============0431357774== Content-Type: message/rfc822 MIME-Version: 1.0 Received: from raisinbran.srv.cs.cmu.edu (RAISINBRAN.SRV.CS.CMU.EDU [128.2.200.9]) by loganberry.srv.cs.cmu.edu (8.13.6/8.13.6) with ESMTP id m0BEaDUv007013 for ; Fri, 11 Jan 2008 09:37:38 -0500 (EST) Received: from oss.sgi.com (catv-506345a6.catv.broadband.hu [80.99.69.166]) by raisinbran.srv.cs.cmu.edu (8.13.6/8.13.6) with ESMTP id m0BBssLh016103 for ; Fri, 11 Jan 2008 06:55:04 -0500 (EST) Message-Id: <200801111155.m0BBssLh016103@raisinbran.srv.cs.cmu.edu> From: xfs@oss.sgi.com To: connectionists@cs.cmu.edu Subject: [PMX:VIRUS] Returned mail: see transcript for details Date: Fri, 11 Jan 2008 12:53:51 +0100 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0012_804642CF.453679A4" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-PMX-Version: 5.4.1.325704, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2008.1.11.33257 X-PerlMx-Virus-Detected: W32/MyDoom-O This is a multi-part message in MIME format. ------=_NextPart_000_0012_804642CF.453679A4 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit The message was undeliverable due to the following reason: Your message could not be delivered because the destination server was not reachable within the allowed queue period. The amount of time a message is queued before it is returned depends on local configura- tion parameters. Most likely there is a network problem that prevented delivery, but it is also possible that the computer is turned off, or does not have a mail system running right now. Your message could not be delivered within 3 days: Host 85.78.120.123 is not responding. The following recipients could not receive this message: Please reply to postmaster@oss.sgi.com if you feel this message to be in error. ------=_NextPart_000_0012_804642CF.453679A4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The original content of this message part has been replaced by this text because it tested positive for the following virus(es): W32/MyDoom-O, W32/MyDoom-O The original message has been quarantined pending further action by the mail administrator. For further information about the message and its delivery status, please contact the undersigned, and include the full content of this message. The identifier for this message is 'm0BBssLh016103'. This notification is being sent to you and any other original envelope recipient(s). To avoid creating a nuisance and to keep mail traffic under control, the original sender of the message has NOT been notified. However, you may want to notify the sender at your discretion. The Management PureMessage Admin ------=_NextPart_000_0012_804642CF.453679A4-- --===============0431357774==-- From owner-xfs@oss.sgi.com Fri Jan 11 14:24:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 11 Jan 2008 14:25:00 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0BMOXcs000402 for ; Fri, 11 Jan 2008 14:24:36 -0800 X-ASG-Debug-ID: 1200090290-142100430000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ext.agami.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CD14150F402 for ; Fri, 11 Jan 2008 14:24:50 -0800 (PST) Received: from ext.agami.com (64.221.212.177.ptr.us.xo.net [64.221.212.177]) by cuda.sgi.com with ESMTP id 8Kg6yiB299TQ143Y for ; Fri, 11 Jan 2008 14:24:50 -0800 (PST) Received: from agami.com (mail [192.168.168.5]) by ext.agami.com (8.12.5/8.12.5) with ESMTP id m0BMH3Wb018900 for ; Fri, 11 Jan 2008 14:17:04 -0800 Received: from mx1.agami.com (mx1.agami.com [10.123.10.30]) by agami.com (8.12.11/8.12.11) with ESMTP id m0BMGwL3002040 for ; Fri, 11 Jan 2008 14:16:58 -0800 Received: from [10.123.4.142] ([10.123.4.142]) by mx1.agami.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 11 Jan 2008 14:17:21 -0800 Message-ID: <4787EAF1.4080305@agami.com> Date: Fri, 11 Jan 2008 14:17:21 -0800 From: Michael Nishimoto User-Agent: Mail/News 1.5.0.4 (X11/20060629) MIME-Version: 1.0 To: Russell Cattelan CC: XFS Mailing List X-ASG-Orig-Subj: Re: CVS access down? Subject: Re: CVS access down? References: <4786D35C.9030104@thebarn.com> In-Reply-To: <4786D35C.9030104@thebarn.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 11 Jan 2008 22:17:21.0560 (UTC) FILETIME=[BC4AA180:01C8549F] X-Scanned-By: MIMEDefang 2.58 on 192.168.168.13 X-Barracuda-Connect: 64.221.212.177.ptr.us.xo.net[64.221.212.177] X-Barracuda-Start-Time: 1200090290 X-Barracuda-Bayes: INNOCENT GLOBAL 0.1420 1.0000 -1.1466 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.15 X-Barracuda-Spam-Status: No, SCORE=-1.15 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39261 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5478/Fri Jan 11 07:39:22 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14104 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: miken@agami.com Precedence: bulk X-list: xfs Russell Cattelan wrote: > Michael Nishimoto wrote: > > It appears that CVS access is down. Can someone please take > > a look to see what's broken? > > > > Thanks! > > > Anymore info? > I just did quick test > cvs -d :pserver:cvs@oss.sgi.com:/cvs co xfs-cmds > > seems to be working fine for me. > > -Russell Sorry, it ends up that this was my fault. Michael From owner-xfs@oss.sgi.com Sat Jan 12 17:46:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 12 Jan 2008 17:46:52 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0D1kjmI021289 for ; Sat, 12 Jan 2008 17:46:47 -0800 X-ASG-Debug-ID: 1200188821-363400210000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ns1.anodized.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E57F3512BF0 for ; Sat, 12 Jan 2008 17:47:01 -0800 (PST) Received: from ns1.anodized.com (ns1.anodized.com [204.15.208.61]) by cuda.sgi.com with ESMTP id oaIBHPtLJVFurhrY for ; Sat, 12 Jan 2008 17:47:01 -0800 (PST) Received: from ns1.anodized.com (localhost [127.0.0.1]) by ns1.anodized.com (8.13.1/8.13.1) with ESMTP id m0D1l0XH031205 for ; Sat, 12 Jan 2008 17:47:00 -0800 Received: from 127.0.0.1 ([127.0.0.1] helo=ns1.anodized.com) by ASSP-nospam; 12 Jan 2008 17:47:00 -0800 Received: (from clayne@localhost) by ns1.anodized.com (8.13.1/8.13.1/Submit) id m0D1l0Ql031202 for xfs@oss.sgi.com; Sat, 12 Jan 2008 17:47:00 -0800 Date: Sat, 12 Jan 2008 17:46:59 -0800 From: Christopher Layne To: xfs@oss.sgi.com X-ASG-Orig-Subj: xfs_fsr: circular dependency under 2.6.24-rc6 Subject: xfs_fsr: circular dependency under 2.6.24-rc6 Message-ID: <20080113014659.GO26626@ns1.anodized.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.11 X-Assp-Spam-Prob: 0.00000 X-Assp-Whitelisted: Yes X-Assp-Envelope-From: clayne@ns1.anodized.com X-Assp-Intended-For: xfs@oss.sgi.com X-Barracuda-Connect: ns1.anodized.com[204.15.208.61] X-Barracuda-Start-Time: 1200188822 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39372 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M BODY: Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/5479/Sat Jan 12 15:08:34 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14105 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: clayne@anodized.com Precedence: bulk X-list: xfs ======================================================= [ INFO: possible circular locking dependency detected ] 2.6.24-rc6 #1 ------------------------------------------------------- xfs_fsr/5694 is trying to acquire lock: (&mm->mmap_sem){----}, at: [] dio_get_page+0x4b/0x184 but task is already holding lock: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x4d/0x8d which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&(&ip->i_iolock)->mr_lock){----}: [] __lock_acquire+0xb2b/0xd3f [] xfs_ilock+0x26/0x8d [] lock_acquire+0x84/0xa8 [] xfs_ilock+0x26/0x8d [] mark_held_locks+0x58/0x72 [] down_write_nested+0x39/0x45 [] xfs_ilock+0x26/0x8d [] xfs_ireclaim+0x37/0x7a [] xfs_finish_reclaim+0x15d/0x16b [] xfs_fs_clear_inode+0xca/0xeb [] clear_inode+0x94/0xeb [] dispose_list+0x58/0xfa [] invalidate_inodes+0xd9/0xf7 [] generic_shutdown_super+0x39/0xf3 [] kill_block_super+0xd/0x1e [] deactivate_super+0x49/0x61 [] sys_umount+0x1f5/0x206 [] trace_hardirqs_on_thunk+0x35/0x3a [] trace_hardirqs_on+0x121/0x14c [] trace_hardirqs_on_thunk+0x35/0x3a [] system_call+0x7e/0x83 [] 0xffffffffffffffff -> #1 (iprune_mutex){--..}: [] __lock_acquire+0xb2b/0xd3f [] shrink_icache_memory+0x42/0x214 [] lock_acquire+0x84/0xa8 [] shrink_icache_memory+0x42/0x214 [] __lock_acquire+0xd1e/0xd3f [] shrink_icache_memory+0x42/0x214 [] mutex_lock_nested+0xfd/0x297 [] prune_dcache+0xd8/0x184 [] shrink_icache_memory+0x42/0x214 [] shrink_slab+0xe7/0x15a [] try_to_free_pages+0x17a/0x24b [] __alloc_pages+0x208/0x34e [] handle_mm_fault+0x211/0x66d [] do_page_fault+0x3bd/0x743 [] __up_write+0x21/0x112 [] __up_write+0x21/0x112 [] _spin_unlock_irqrestore+0x3e/0x44 [] trace_hardirqs_on_thunk+0x35/0x3a [] trace_hardirqs_on+0x121/0x14c [] error_exit+0x0/0xa9 [] 0xffffffffffffffff -> #0 (&mm->mmap_sem){----}: [] __lock_acquire+0xa30/0xd3f [] dio_get_page+0x4b/0x184 [] lock_acquire+0x84/0xa8 [] dio_get_page+0x4b/0x184 [] down_read+0x32/0x3b [] dio_get_page+0x4b/0x184 [] __spin_lock_init+0x29/0x47 [] __blockdev_direct_IO+0x3fc/0x9c6 [] lockdep_init_map+0x8f/0x460 [] xfs_vm_direct_IO+0x101/0x134 [] xfs_get_blocks_direct+0x0/0x11 [] xfs_end_io_direct+0x0/0x82 [] __up_write+0x21/0x112 [] generic_file_direct_IO+0xcd/0x103 [] generic_file_direct_write+0x60/0xfd [] xfs_write+0x4ed/0x760 [] xfs_iunlock+0x37/0x85 [] xfs_read+0x1f1/0x210 [] do_sync_write+0xd1/0x118 [] __lock_acquire+0xd1e/0xd3f [] autoremove_wake_function+0x0/0x2e [] dnotify_parent+0x1f/0x6d [] vfs_write+0xad/0x136 [] sys_write+0x45/0x6e [] system_call+0x7e/0x83 [] 0xffffffffffffffff other info that might help us debug this: 1 lock held by xfs_fsr/5694: #0: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x4d/0x8d stack backtrace: Pid: 5694, comm: xfs_fsr Not tainted 2.6.24-rc6 #1 Call Trace: [] print_circular_bug_tail+0x69/0x72 [] __lock_acquire+0xa30/0xd3f [] dio_get_page+0x4b/0x184 [] lock_acquire+0x84/0xa8 [] dio_get_page+0x4b/0x184 [] down_read+0x32/0x3b [] dio_get_page+0x4b/0x184 [] __spin_lock_init+0x29/0x47 [] __blockdev_direct_IO+0x3fc/0x9c6 [] lockdep_init_map+0x8f/0x460 [] xfs_vm_direct_IO+0x101/0x134 [] xfs_get_blocks_direct+0x0/0x11 [] xfs_end_io_direct+0x0/0x82 [] __up_write+0x21/0x112 [] generic_file_direct_IO+0xcd/0x103 [] generic_file_direct_write+0x60/0xfd [] xfs_write+0x4ed/0x760 [] xfs_iunlock+0x37/0x85 [] xfs_read+0x1f1/0x210 [] do_sync_write+0xd1/0x118 [] __lock_acquire+0xd1e/0xd3f [] autoremove_wake_function+0x0/0x2e [] dnotify_parent+0x1f/0x6d [] vfs_write+0xad/0x136 [] sys_write+0x45/0x6e [] system_call+0x7e/0x83 -- xfs issue or kernel issue? -cl From owner-xfs@oss.sgi.com Sun Jan 13 08:23:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 13 Jan 2008 08:23:37 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0DGNVvv009221 for ; Sun, 13 Jan 2008 08:23:33 -0800 X-ASG-Debug-ID: 1200241428-55eb039b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from harold.telenet-ops.be (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B570A514390 for ; Sun, 13 Jan 2008 08:23:48 -0800 (PST) Received: from harold.telenet-ops.be (harold.telenet-ops.be [195.130.133.65]) by cuda.sgi.com with ESMTP id JU1jGEMwevmFKoYI for ; Sun, 13 Jan 2008 08:23:48 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by harold.telenet-ops.be (Postfix) with SMTP id 6039C3004E for ; Sun, 13 Jan 2008 17:23:15 +0100 (CET) Received: from 78-20-142-234.access.telenet.be (78-20-142-234.access.telenet.be [78.20.142.234]) by harold.telenet-ops.be (Postfix) with ESMTP id 540BF30024 for ; Sun, 13 Jan 2008 17:23:15 +0100 (CET) From: "Grozdan Nikolov (openSUSE Linux)" To: xfs@oss.sgi.com X-ASG-Orig-Subj: Cannot delete a directory on a XFS file system Subject: Cannot delete a directory on a XFS file system Date: Sun, 13 Jan 2008 17:23:12 +0100 User-Agent: KMail/1.9.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801131723.12626.microchip@telenet.be> X-Barracuda-Connect: harold.telenet-ops.be[195.130.133.65] X-Barracuda-Start-Time: 1200241428 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39429 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5480/Sun Jan 13 05:17:55 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14106 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: microchip@telenet.be Precedence: bulk X-list: xfs Hi, I have a small problem with XFS on a small 40 GB IDE disk that I use for my music collection. The disk (/dev/hdb) has only one partition on it formatted as XFS. On this partition, there is a directory that no matter what I do, I cannot delete it. I tried everything, in Konqueror, right-click on the directory and choose to delete it. As root on the console doing "rm -rf /media/data/DATA/MusicApps" ... but nothing works. When I try to "rm -rf" on this directory I get a message saying... rm: cannot remove directory `MusicApps/Loops/loops/Acid Loops/Bass': Directory not empty But the "Bass" directory is completely empty, there's nothing in there. Also when I unmount the file system and do a "xfs_check /dev/hdb1" I get a message saying... link count mismatch for inode 184549517 (name ?), nlink 3, counted 2 I did several times "xfs_repair /dev/hdb1" but I still get the same result. xfs_check reports the same message and I still can't get rid of this empty directory. I'm using kernel 2.6.24-rc7, but it's the same with other kernels. I also did check the partition for bad block with the "badblocks" program, but nothing came out, so the disk is just fine. Any ideas how I can delete this directory? From owner-xfs@oss.sgi.com Sun Jan 13 11:49:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 13 Jan 2008 11:49:54 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0DJnhJm024261 for ; Sun, 13 Jan 2008 11:49:47 -0800 X-ASG-Debug-ID: 1200253801-5b5f01730000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7C00E514CAF for ; Sun, 13 Jan 2008 11:50:01 -0800 (PST) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id ZBi8shzv2JgQyta0 for ; Sun, 13 Jan 2008 11:50:01 -0800 (PST) Received: by lucidpixels.com (Postfix, from userid 1001) id 0A3B61C003F2E; Sun, 13 Jan 2008 14:49:30 -0500 (EST) Date: Sun, 13 Jan 2008 14:49:30 -0500 (EST) From: Justin Piszcz X-X-Sender: jpiszcz@p34.internal.lan To: "Grozdan Nikolov (openSUSE Linux)" cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Cannot delete a directory on a XFS file system Subject: Re: Cannot delete a directory on a XFS file system In-Reply-To: <200801131723.12626.microchip@telenet.be> Message-ID: References: <200801131723.12626.microchip@telenet.be> User-Agent: Alpine 0.999999 (DEB 847 2007-12-06) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1200253801 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39444 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5481/Sun Jan 13 10:04:16 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14107 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Sun, 13 Jan 2008, Grozdan Nikolov (openSUSE Linux) wrote: > Hi, > > I have a small problem with XFS on a small 40 GB IDE disk that I use for my > music collection. The disk (/dev/hdb) has only one partition on it formatted > as XFS. On this partition, there is a directory that no matter what I do, I > cannot delete it. I tried everything, in Konqueror, right-click on the > directory and choose to delete it. As root on the console > doing "rm -rf /media/data/DATA/MusicApps" ... but nothing works. > > When I try to "rm -rf" on this directory I get a message saying... > > rm: cannot remove directory `MusicApps/Loops/loops/Acid Loops/Bass': Directory > not empty > > But the "Bass" directory is completely empty, there's nothing in there. Also > when I unmount the file system and do a "xfs_check /dev/hdb1" I get a message > saying... > > link count mismatch for inode 184549517 (name ?), nlink 3, counted 2 > > I did several times "xfs_repair /dev/hdb1" but I still get the same result. > xfs_check reports the same message and I still can't get rid of this empty > directory. I'm using kernel 2.6.24-rc7, but it's the same with other kernels. > I also did check the partition for bad block with the "badblocks" program, > but nothing came out, so the disk is just fine. > > Any ideas how I can delete this directory? > > The developers get in on Monday :P But some things they will ask: 1. run xfs_info /dev/hdb1 2. run (and capture the full output from the repair process) 3. run ls -lR on the dir that has problems 4. run ls -li on the director(ies) that cannot be deleted for the inode #s If you give them this information in advance they'll have more info to help you. Justin. From owner-xfs@oss.sgi.com Sun Jan 13 13:26:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 13 Jan 2008 13:26:50 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_45 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0DLQhnC005314 for ; Sun, 13 Jan 2008 13:26:47 -0800 X-ASG-Debug-ID: 1200259620-1dc400410000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from harold.telenet-ops.be (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 75DAF5150A6 for ; Sun, 13 Jan 2008 13:27:00 -0800 (PST) Received: from harold.telenet-ops.be (harold.telenet-ops.be [195.130.133.65]) by cuda.sgi.com with ESMTP id MUDHghIjkrgdTA2U for ; Sun, 13 Jan 2008 13:27:00 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by harold.telenet-ops.be (Postfix) with SMTP id 4788830044; Sun, 13 Jan 2008 22:26:59 +0100 (CET) Received: from 78-20-142-234.access.telenet.be (78-20-142-234.access.telenet.be [78.20.142.234]) by harold.telenet-ops.be (Postfix) with ESMTP id 2FEAC3003E; Sun, 13 Jan 2008 22:26:59 +0100 (CET) From: "Grozdan Nikolov (openSUSE Linux)" To: Justin Piszcz X-ASG-Orig-Subj: Re: Cannot delete a directory on a XFS file system Subject: Re: Cannot delete a directory on a XFS file system Date: Sun, 13 Jan 2008 22:26:59 +0100 User-Agent: KMail/1.9.5 References: <200801131723.12626.microchip@telenet.be> In-Reply-To: Cc: xfs@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Message-Id: <200801132226.59652.microchip@telenet.be> X-Barracuda-Connect: harold.telenet-ops.be[195.130.133.65] X-Barracuda-Start-Time: 1200259621 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39450 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5481/Sun Jan 13 10:04:16 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m0DLQlnC005320 X-archive-position: 14108 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: microchip@telenet.be Precedence: bulk X-list: xfs On Sunday 13 January 2008 20:49, you wrote: > On Sun, 13 Jan 2008, Grozdan Nikolov (openSUSE Linux) wrote: > > Hi, > > > > I have a small problem with XFS on a small 40 GB IDE disk that I use for > > my music collection. The disk (/dev/hdb) has only one partition on it > > formatted as XFS. On this partition, there is a directory that no matter > > what I do, I cannot delete it. I tried everything, in Konqueror, > > right-click on the directory and choose to delete it. As root on the > > console > > doing "rm -rf /media/data/DATA/MusicApps" ... but nothing works. > > > > When I try to "rm -rf" on this directory I get a message saying... > > > > rm: cannot remove directory `MusicApps/Loops/loops/Acid Loops/Bass': > > Directory not empty > > > > But the "Bass" directory is completely empty, there's nothing in there. > > Also when I unmount the file system and do a "xfs_check /dev/hdb1" I get > > a message saying... > > > > link count mismatch for inode 184549517 (name ?), nlink 3, counted 2 > > > > I did several times "xfs_repair /dev/hdb1" but I still get the same > > result. xfs_check reports the same message and I still can't get rid of > > this empty directory. I'm using kernel 2.6.24-rc7, but it's the same with > > other kernels. I also did check the partition for bad block with the > > "badblocks" program, but nothing came out, so the disk is just fine. > > > > Any ideas how I can delete this directory? > > The developers get in on Monday :P > > But some things they will ask: > > 1. run xfs_info /dev/hdb1 meta-data=/dev/hdb1              isize=256    agcount=16, agsize=610595 blks          =                       sectsz=512   attr=0 data     =                       bsize=4096   blocks=9769520, imaxpct=25          =                       sunit=0      swidth=0 blks, unwritten=1 naming   =version 2              bsize=4096 log      =internal               bsize=4096   blocks=4770, version=1          =                       sectsz=512   sunit=0 blks realtime =none                   extsz=65536  blocks=0, rtextents=0 > 2. run (and capture the full output from the repair process) 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 > 3. run ls -lR on the dir that has problems MusicApps: total 0 drwxr-xr-x 3 microchip users 18 2007-12-16 02:02 Loops MusicApps/Loops: total 0 drwxr-xr-x 3 microchip users 23 2007-12-16 02:02 loops MusicApps/Loops/loops: total 0 drwxr-xr-x 3 microchip users 17 2007-12-16 02:02 Acid Loops MusicApps/Loops/loops/Acid Loops: total 0 drwxr-xr-x 3 microchip users 6 2007-12-16 02:02 Bass MusicApps/Loops/loops/Acid Loops/Bass: total 0 > 4. run ls -li on the director(ies) that cannot be deleted for the inode #s total 0 201326732 drwxr-xr-x 3 microchip users 18 2007-12-16 02:02 Loops > > If you give them this information in advance they'll have more info to > help you. > > Justin. From owner-xfs@oss.sgi.com Sun Jan 13 13:27:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 13 Jan 2008 13:27:46 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0DLRcAs005480 for ; Sun, 13 Jan 2008 13:27:41 -0800 X-ASG-Debug-ID: 1200259676-6f8500bd0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E14E75150AF for ; Sun, 13 Jan 2008 13:27:56 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id A7uo4m6kTkYGcZDh for ; Sun, 13 Jan 2008 13:27:56 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id CA87518CFB083; Sun, 13 Jan 2008 15:27:54 -0600 (CST) Message-ID: <478A8256.8030000@sandeen.net> Date: Sun, 13 Jan 2008 15:27:50 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Justin Piszcz CC: "Grozdan Nikolov (openSUSE Linux)" , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Cannot delete a directory on a XFS file system Subject: Re: Cannot delete a directory on a XFS file system References: <200801131723.12626.microchip@telenet.be> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200259676 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39450 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5481/Sun Jan 13 10:04:16 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14109 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 Justin Piszcz wrote: > > On Sun, 13 Jan 2008, Grozdan Nikolov (openSUSE Linux) wrote: > >> Hi, >> >> I have a small problem with XFS on a small 40 GB IDE disk that I use for my >> music collection. The disk (/dev/hdb) has only one partition on it formatted >> as XFS. On this partition, there is a directory that no matter what I do, I >> cannot delete it. I tried everything, in Konqueror, right-click on the >> directory and choose to delete it. As root on the console >> doing "rm -rf /media/data/DATA/MusicApps" ... but nothing works. >> >> When I try to "rm -rf" on this directory I get a message saying... >> >> rm: cannot remove directory `MusicApps/Loops/loops/Acid Loops/Bass': Directory >> not empty >> >> But the "Bass" directory is completely empty, there's nothing in there. Also >> when I unmount the file system and do a "xfs_check /dev/hdb1" I get a message >> saying... >> >> link count mismatch for inode 184549517 (name ?), nlink 3, counted 2 >> >> I did several times "xfs_repair /dev/hdb1" but I still get the same result. >> xfs_check reports the same message and I still can't get rid of this empty >> directory. I'm using kernel 2.6.24-rc7, but it's the same with other kernels. >> I also did check the partition for bad block with the "badblocks" program, >> but nothing came out, so the disk is just fine. >> >> Any ideas how I can delete this directory? >> >> > > The developers get in on Monday :P > > But some things they will ask: > > 1. run xfs_info /dev/hdb1 > 2. run (and capture the full output from the repair process) ... with very latest xfsprogs please. If latest repair doesn't fix it, using xfs_metadump to provide a filesystem image for Barry to reproduce with would be helpful. > 3. run ls -lR on the dir that has problems > 4. run ls -li on the director(ies) that cannot be deleted for the inode #s ls -a on the dir to be sure there are no hidden dotfiles ls -id on the dir to see if it is inode 184549517 -Eric From owner-xfs@oss.sgi.com Sun Jan 13 13:38:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 13 Jan 2008 13:38:41 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0DLcZBW007157 for ; Sun, 13 Jan 2008 13:38:37 -0800 X-ASG-Debug-ID: 1200260332-244c004c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from edna.telenet-ops.be (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7CA4411CA579 for ; Sun, 13 Jan 2008 13:38:52 -0800 (PST) Received: from edna.telenet-ops.be (edna.telenet-ops.be [195.130.132.58]) by cuda.sgi.com with ESMTP id SdDHXkAeiQe70VwR for ; Sun, 13 Jan 2008 13:38:52 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by edna.telenet-ops.be (Postfix) with SMTP id 0F13FE406F; Sun, 13 Jan 2008 22:38:52 +0100 (CET) Received: from 78-20-142-234.access.telenet.be (78-20-142-234.access.telenet.be [78.20.142.234]) by edna.telenet-ops.be (Postfix) with ESMTP id F2A8BE4042; Sun, 13 Jan 2008 22:38:51 +0100 (CET) From: "Grozdan Nikolov (openSUSE Linux)" To: Eric Sandeen X-ASG-Orig-Subj: Re: Cannot delete a directory on a XFS file system Subject: Re: Cannot delete a directory on a XFS file system Date: Sun, 13 Jan 2008 22:38:51 +0100 User-Agent: KMail/1.9.5 References: <200801131723.12626.microchip@telenet.be> <478A8256.8030000@sandeen.net> In-Reply-To: <478A8256.8030000@sandeen.net> Cc: xfs@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801132238.52075.microchip@telenet.be> X-Barracuda-Connect: edna.telenet-ops.be[195.130.132.58] X-Barracuda-Start-Time: 1200260333 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39451 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5481/Sun Jan 13 10:04:16 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14110 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: microchip@telenet.be Precedence: bulk X-list: xfs On Sunday 13 January 2008 22:27, you wrote: > Justin Piszcz wrote: > > On Sun, 13 Jan 2008, Grozdan Nikolov (openSUSE Linux) wrote: > >> Hi, > >> > >> I have a small problem with XFS on a small 40 GB IDE disk that I use for > >> my music collection. The disk (/dev/hdb) has only one partition on it > >> formatted as XFS. On this partition, there is a directory that no matter > >> what I do, I cannot delete it. I tried everything, in Konqueror, > >> right-click on the directory and choose to delete it. As root on the > >> console > >> doing "rm -rf /media/data/DATA/MusicApps" ... but nothing works. > >> > >> When I try to "rm -rf" on this directory I get a message saying... > >> > >> rm: cannot remove directory `MusicApps/Loops/loops/Acid Loops/Bass': > >> Directory not empty > >> > >> But the "Bass" directory is completely empty, there's nothing in there. > >> Also when I unmount the file system and do a "xfs_check /dev/hdb1" I get > >> a message saying... > >> > >> link count mismatch for inode 184549517 (name ?), nlink 3, counted 2 > >> > >> I did several times "xfs_repair /dev/hdb1" but I still get the same > >> result. xfs_check reports the same message and I still can't get rid of > >> this empty directory. I'm using kernel 2.6.24-rc7, but it's the same > >> with other kernels. I also did check the partition for bad block with > >> the "badblocks" program, but nothing came out, so the disk is just fine. > >> > >> Any ideas how I can delete this directory? > > > > The developers get in on Monday :P > > > > But some things they will ask: > > > > 1. run xfs_info /dev/hdb1 > > 2. run (and capture the full output from the repair process) > > ... with very latest xfsprogs please. If latest repair doesn't fix it, I do not know what version is the latest of xfsprogs. I use my distro's default (2.8.11) > using xfs_metadump to provide a filesystem image for Barry to reproduce > with would be helpful. I can't find xfs_metadump on my system. I only have xfsdump. Is this the same? > > > 3. run ls -lR on the dir that has problems > > 4. run ls -li on the director(ies) that cannot be deleted for the inode > > #s > > ls -a on the dir to be sure there are no hidden dotfiles ls -a MusicApps . .. Loops ls -a "MusicApps/Loops/loops/Acid Loops/Bass" . .. > ls -id on the dir to see if it is inode 184549517 ls -id "MusicApps/Loops/loops/Acid Loops/Bass" 184549517 MusicApps/Loops/loops/Acid Loops/Bass > > -Eric From owner-xfs@oss.sgi.com Sun Jan 13 13:51:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 13 Jan 2008 13:52:11 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0DLpgbo008485 for ; Sun, 13 Jan 2008 13:51:45 -0800 X-ASG-Debug-ID: 1200261119-456c00040000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7022411CA622 for ; Sun, 13 Jan 2008 13:52:00 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id yFpNzj2i9aNxsG8l for ; Sun, 13 Jan 2008 13:52:00 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 4D12F18CFB06D; Sun, 13 Jan 2008 15:51:58 -0600 (CST) Message-ID: <478A87FD.60203@sandeen.net> Date: Sun, 13 Jan 2008 15:51:57 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: "Grozdan Nikolov (openSUSE Linux)" CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Cannot delete a directory on a XFS file system Subject: Re: Cannot delete a directory on a XFS file system References: <200801131723.12626.microchip@telenet.be> <478A8256.8030000@sandeen.net> <200801132238.52075.microchip@telenet.be> In-Reply-To: <200801132238.52075.microchip@telenet.be> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200261120 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39451 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5481/Sun Jan 13 10:04:16 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14111 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 Grozdan Nikolov (openSUSE Linux) wrote: > I do not know what version is the latest of xfsprogs. I use my distro's > default (2.8.11) Ok, 2.9.4 is latest. 2.8.11 is from Aug 2006.... Perhaps the more recent version will properly fix your fs. From the changelog: xfsprogs-2.8.15 (19 October 2006) - Fix up nlink checks and repairs in phase 7 for xfs_repair. >> using xfs_metadump to provide a filesystem image for Barry to reproduce >> with would be helpful. > > I can't find xfs_metadump on my system. I only have xfsdump. Is this the same? Nope, it's not there in your older xfsprogs. >>> 3. run ls -lR on the dir that has problems >>> 4. run ls -li on the director(ies) that cannot be deleted for the inode >>> #s >> ls -a on the dir to be sure there are no hidden dotfiles > ls -a "MusicApps/Loops/loops/Acid Loops/Bass" > > . .. Ok, no hidden files. > >> ls -id on the dir to see if it is inode 184549517 > > ls -id "MusicApps/Loops/loops/Acid Loops/Bass" So, the dir you can't delete is the one with the link count mismatch stated by xfs_check - that's what I figured but wanted to double check. I'd be willing to bet that the latest xfsprogs would fix this for you. Alternately some xfs_db hackery could too, but using more recent repair would be the best route I think. -Eric > 184549517 MusicApps/Loops/loops/Acid Loops/Bass > >> -Eric > From owner-xfs@oss.sgi.com Sun Jan 13 14:56:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 13 Jan 2008 14:56:32 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0DMuQwR013348 for ; Sun, 13 Jan 2008 14:56:27 -0800 X-ASG-Debug-ID: 1200265000-740c00060000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from monty.telenet-ops.be (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E570311CA98A for ; Sun, 13 Jan 2008 14:56:40 -0800 (PST) Received: from monty.telenet-ops.be (monty.telenet-ops.be [195.130.132.56]) by cuda.sgi.com with ESMTP id BOdyu2yVYa2JyfYz for ; Sun, 13 Jan 2008 14:56:40 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by monty.telenet-ops.be (Postfix) with SMTP id 26F205403D; Sun, 13 Jan 2008 23:56:39 +0100 (CET) Received: from 78-20-142-234.access.telenet.be (78-20-142-234.access.telenet.be [78.20.142.234]) by monty.telenet-ops.be (Postfix) with ESMTP id 185435400C; Sun, 13 Jan 2008 23:56:38 +0100 (CET) From: "Grozdan Nikolov (openSUSE Linux)" To: Eric Sandeen X-ASG-Orig-Subj: Re: Cannot delete a directory on a XFS file system Subject: Re: Cannot delete a directory on a XFS file system Date: Sun, 13 Jan 2008 23:56:39 +0100 User-Agent: KMail/1.9.5 References: <200801131723.12626.microchip@telenet.be> <200801132238.52075.microchip@telenet.be> <478A87FD.60203@sandeen.net> In-Reply-To: <478A87FD.60203@sandeen.net> Cc: xfs@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801132356.39966.microchip@telenet.be> X-Barracuda-Connect: monty.telenet-ops.be[195.130.132.56] X-Barracuda-Start-Time: 1200265003 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39454 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5481/Sun Jan 13 10:04:16 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14112 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: microchip@telenet.be Precedence: bulk X-list: xfs On Sunday 13 January 2008 22:51, you wrote: > Grozdan Nikolov (openSUSE Linux) wrote: > > I do not know what version is the latest of xfsprogs. I use my distro's > > default (2.8.11) > > Ok, 2.9.4 is latest. 2.8.11 is from Aug 2006.... Perhaps the more > recent version will properly fix your fs. > > From the changelog: > > xfsprogs-2.8.15 (19 October 2006) > - Fix up nlink checks and repairs in phase 7 for xfs_repair. ok, I added the latest version of xfsprogs from the SUSE build service, ran xfs_repair /dev/hdb1 and when it finished it resetted the inode... resetting inode 184549517 nlinks from 3 to 2 after this, I was able to delete the directory. Thank for all your help :) > > >> using xfs_metadump to provide a filesystem image for Barry to reproduce > >> with would be helpful. > > > > I can't find xfs_metadump on my system. I only have xfsdump. Is this the > > same? > > Nope, it's not there in your older xfsprogs. > > >>> 3. run ls -lR on the dir that has problems > >>> 4. run ls -li on the director(ies) that cannot be deleted for the inode > >>> #s > >> > >> ls -a on the dir to be sure there are no hidden dotfiles > > > > ls -a "MusicApps/Loops/loops/Acid Loops/Bass" > > > > . .. > > Ok, no hidden files. > > >> ls -id on the dir to see if it is inode 184549517 > > > > ls -id "MusicApps/Loops/loops/Acid Loops/Bass" > > So, the dir you can't delete is the one with the link count mismatch > stated by xfs_check - that's what I figured but wanted to double check. > > I'd be willing to bet that the latest xfsprogs would fix this for you. > > Alternately some xfs_db hackery could too, but using more recent repair > would be the best route I think. > > -Eric > > > 184549517 MusicApps/Loops/loops/Acid Loops/Bass > > > >> -Eric From owner-xfs@oss.sgi.com Sun Jan 13 16:15:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 13 Jan 2008 16:16:00 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0E0Fm8u019119 for ; Sun, 13 Jan 2008 16:15:53 -0800 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA05184; Mon, 14 Jan 2008 11:16:00 +1100 Message-ID: <478AAA73.3080008@sgi.com> Date: Mon, 14 Jan 2008 11:18:59 +1100 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.9 (X11/20071031) MIME-Version: 1.0 To: Christopher Layne CC: xfs@oss.sgi.com Subject: Re: xfs_fsr: circular dependency under 2.6.24-rc6 References: <20080113014659.GO26626@ns1.anodized.com> In-Reply-To: <20080113014659.GO26626@ns1.anodized.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/5482/Sun Jan 13 13:43:51 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14113 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Christopher, This is a known dependency and is actually a false alarm. The inode that is being reclaimed (thread #2) cannot have writes in progress (thread #0) since they cannot involve the same i_iolock. We cannot change the code to work around this nor can we add lockdep annotations to avoid this case. You can safely ignore this lockdep report. Lachlan Christopher Layne wrote: > ======================================================= > [ INFO: possible circular locking dependency detected ] > 2.6.24-rc6 #1 > ------------------------------------------------------- > xfs_fsr/5694 is trying to acquire lock: > (&mm->mmap_sem){----}, at: [] dio_get_page+0x4b/0x184 > > but task is already holding lock: > (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x4d/0x8d > > which lock already depends on the new lock. > > > the existing dependency chain (in reverse order) is: > > -> #2 (&(&ip->i_iolock)->mr_lock){----}: > [] __lock_acquire+0xb2b/0xd3f > [] xfs_ilock+0x26/0x8d > [] lock_acquire+0x84/0xa8 > [] xfs_ilock+0x26/0x8d > [] mark_held_locks+0x58/0x72 > [] down_write_nested+0x39/0x45 > [] xfs_ilock+0x26/0x8d > [] xfs_ireclaim+0x37/0x7a > [] xfs_finish_reclaim+0x15d/0x16b > [] xfs_fs_clear_inode+0xca/0xeb > [] clear_inode+0x94/0xeb > [] dispose_list+0x58/0xfa > [] invalidate_inodes+0xd9/0xf7 > [] generic_shutdown_super+0x39/0xf3 > [] kill_block_super+0xd/0x1e > [] deactivate_super+0x49/0x61 > [] sys_umount+0x1f5/0x206 > [] trace_hardirqs_on_thunk+0x35/0x3a > [] trace_hardirqs_on+0x121/0x14c > [] trace_hardirqs_on_thunk+0x35/0x3a > [] system_call+0x7e/0x83 > [] 0xffffffffffffffff > > -> #1 (iprune_mutex){--..}: > [] __lock_acquire+0xb2b/0xd3f > [] shrink_icache_memory+0x42/0x214 > [] lock_acquire+0x84/0xa8 > [] shrink_icache_memory+0x42/0x214 > [] __lock_acquire+0xd1e/0xd3f > [] shrink_icache_memory+0x42/0x214 > [] mutex_lock_nested+0xfd/0x297 > [] prune_dcache+0xd8/0x184 > [] shrink_icache_memory+0x42/0x214 > [] shrink_slab+0xe7/0x15a > [] try_to_free_pages+0x17a/0x24b > [] __alloc_pages+0x208/0x34e > [] handle_mm_fault+0x211/0x66d > [] do_page_fault+0x3bd/0x743 > [] __up_write+0x21/0x112 > [] __up_write+0x21/0x112 > [] _spin_unlock_irqrestore+0x3e/0x44 > [] trace_hardirqs_on_thunk+0x35/0x3a > [] trace_hardirqs_on+0x121/0x14c > [] error_exit+0x0/0xa9 > [] 0xffffffffffffffff > > -> #0 (&mm->mmap_sem){----}: > [] __lock_acquire+0xa30/0xd3f > [] dio_get_page+0x4b/0x184 > [] lock_acquire+0x84/0xa8 > [] dio_get_page+0x4b/0x184 > [] down_read+0x32/0x3b > [] dio_get_page+0x4b/0x184 > [] __spin_lock_init+0x29/0x47 > [] __blockdev_direct_IO+0x3fc/0x9c6 > [] lockdep_init_map+0x8f/0x460 > [] xfs_vm_direct_IO+0x101/0x134 > [] xfs_get_blocks_direct+0x0/0x11 > [] xfs_end_io_direct+0x0/0x82 > [] __up_write+0x21/0x112 > [] generic_file_direct_IO+0xcd/0x103 > [] generic_file_direct_write+0x60/0xfd > [] xfs_write+0x4ed/0x760 > [] xfs_iunlock+0x37/0x85 > [] xfs_read+0x1f1/0x210 > [] do_sync_write+0xd1/0x118 > [] __lock_acquire+0xd1e/0xd3f > [] autoremove_wake_function+0x0/0x2e > [] dnotify_parent+0x1f/0x6d > [] vfs_write+0xad/0x136 > [] sys_write+0x45/0x6e > [] system_call+0x7e/0x83 > [] 0xffffffffffffffff > > other info that might help us debug this: > > 1 lock held by xfs_fsr/5694: > #0: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x4d/0x8d > > stack backtrace: > Pid: 5694, comm: xfs_fsr Not tainted 2.6.24-rc6 #1 > > Call Trace: > [] print_circular_bug_tail+0x69/0x72 > [] __lock_acquire+0xa30/0xd3f > [] dio_get_page+0x4b/0x184 > [] lock_acquire+0x84/0xa8 > [] dio_get_page+0x4b/0x184 > [] down_read+0x32/0x3b > [] dio_get_page+0x4b/0x184 > [] __spin_lock_init+0x29/0x47 > [] __blockdev_direct_IO+0x3fc/0x9c6 > [] lockdep_init_map+0x8f/0x460 > [] xfs_vm_direct_IO+0x101/0x134 > [] xfs_get_blocks_direct+0x0/0x11 > [] xfs_end_io_direct+0x0/0x82 > [] __up_write+0x21/0x112 > [] generic_file_direct_IO+0xcd/0x103 > [] generic_file_direct_write+0x60/0xfd > [] xfs_write+0x4ed/0x760 > [] xfs_iunlock+0x37/0x85 > [] xfs_read+0x1f1/0x210 > [] do_sync_write+0xd1/0x118 > [] __lock_acquire+0xd1e/0xd3f > [] autoremove_wake_function+0x0/0x2e > [] dnotify_parent+0x1f/0x6d > [] vfs_write+0xad/0x136 > [] sys_write+0x45/0x6e > [] system_call+0x7e/0x83 > > > -- > > xfs issue or kernel issue? > > -cl > > > From owner-xfs@oss.sgi.com Sun Jan 13 19:53:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 13 Jan 2008 19:54:01 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0E3rpiC002745 for ; Sun, 13 Jan 2008 19:53:55 -0800 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA09497; Mon, 14 Jan 2008 14:54:04 +1100 Message-ID: <478ADD90.1000806@sgi.com> Date: Mon, 14 Jan 2008 14:57:04 +1100 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.9 (X11/20071031) MIME-Version: 1.0 To: David Chinner CC: xfs-dev , xfs-oss Subject: Re: [PATCH] make inode reclaim synchronise with xfs_iflush_done() References: <475F878D.6090407@sgi.com> <20071212230858.GO4612@sgi.com> In-Reply-To: <20071212230858.GO4612@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/5482/Sun Jan 13 13:43:51 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14114 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs David Chinner wrote: > (can ppl please post patches in line rather than as attachments > as it's really hard to quote attachments) > > On Wed, Dec 12, 2007 at 06:02:37PM +1100, Lachlan McIlroy wrote: >> On a forced shutdown, xfs_finish_reclaim() will skip flushing the inode. >> If the inode flush lock is not already held and there is an outstanding >> xfs_iflush_done() then we might free the inode prematurely. By acquiring >> and releasing the flush lock we will synchronise with xfs_iflush_done(). > > Yes, That could happen. Good catch. Comments on the code below. > >> Alternatively we could take a hold on the inode when when issuing I/Os >> with xfs_iflush_done() and release it in xfs_iflush_done(). Would this >> be a better approach? > > No - we can't take a hold on the inode because it may not have a linux > inode attached to it and hence there's nothing to hold the reference > count (we use the linux inode reference count for this). > > > --- fs/xfs/xfs_vnodeops.c_1.726 2007-12-12 17:14:59.000000000 +1100 > +++ fs/xfs/xfs_vnodeops.c 2007-12-12 17:15:42.000000000 +1100 > @@ -3762,20 +3762,29 @@ xfs_finish_reclaim( > goto reclaim; > } > xfs_iflock(ip); /* synchronize with xfs_iflush_done */ > + xfs_ifunlock(ip); > } > > Why do you unlock it here? If it is left locked, there is absolutely > no chance for the inode to be flushed again after this point. > > ASSERT(ip->i_update_core == 0); > ASSERT(ip->i_itemp == NULL || > ip->i_itemp->ili_format.ilf_fields == 0); > xfs_iunlock(ip, XFS_ILOCK_EXCL); > - } else if (locked) { > + } else { > /* > * We are not interested in doing an iflush if we're > * in the process of shutting down the filesystem forcibly. > * So, just reclaim the inode. > - */ > - xfs_ifunlock(ip); > - xfs_iunlock(ip, XFS_ILOCK_EXCL); > + * > + * If the flush lock is not already held then temporarily > + * acquire it to synchronize with xfs_iflush_done. > + */ > + if (locked) { > + xfs_ifunlock(ip); > + xfs_iunlock(ip, XFS_ILOCK_EXCL); > + } else { > + xfs_iflock(ip); > + xfs_ifunlock(ip); > + } > } > > Oh, that just makes it messy :/ > > How about locking the inode unconditionally before the entire if..else > statement like: > > + if (!locked) { > + xfs_ilock(ip, XFS_ILOCK_EXCL); > + xfs_iflock(ip); > + } > if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) { > - if (!locked) { > - xfs_ilock(ip, XFS_ILOCK_EXCL); > - xfs_iflock(ip); > - } > > ..... > - } else if (locked) { > + } else { > /* > * We are not interested in doing an iflush if we're > * in the process of shutting down the filesystem forcibly. > * So, just reclaim the inode. > - xfs_ifunlock(ip); > xfs_iunlock(ip, XFS_ILOCK_EXCL); > } > reclaim: > > That would mean we always go to xfs_ireclaim() with the flush lock held > and hence a guarantee that no more I/O can be issued on the inode. That would be a bad thing. We are about to tear the inode down and free the memory. If any threads are still waiting on the flush lock they will wait forever or eventually access freed memory. This patch cleans up the code a little further by removing the 'else if (locked)' case. --- fs/xfs/xfs_vnodeops.c_1.727 2008-01-10 16:00:48.000000000 +1100 +++ fs/xfs/xfs_vnodeops.c 2008-01-11 13:35:41.000000000 +1100 @@ -3721,12 +3721,12 @@ xfs_finish_reclaim( * We get the flush lock regardless, though, just to make sure * we don't free it while it is being flushed. */ - if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) { - if (!locked) { - xfs_ilock(ip, XFS_ILOCK_EXCL); - xfs_iflock(ip); - } + if (!locked) { + xfs_ilock(ip, XFS_ILOCK_EXCL); + xfs_iflock(ip); + } + if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) { if (ip->i_update_core || ((ip->i_itemp != NULL) && (ip->i_itemp->ili_format.ilf_fields != 0))) { @@ -3746,18 +3746,12 @@ xfs_finish_reclaim( ASSERT(ip->i_update_core == 0); ASSERT(ip->i_itemp == NULL || ip->i_itemp->ili_format.ilf_fields == 0); - xfs_iunlock(ip, XFS_ILOCK_EXCL); - } else if (locked) { - /* - * We are not interested in doing an iflush if we're - * in the process of shutting down the filesystem forcibly. - * So, just reclaim the inode. - */ - xfs_ifunlock(ip); - xfs_iunlock(ip, XFS_ILOCK_EXCL); } - reclaim: + xfs_ifunlock(ip); + xfs_iunlock(ip, XFS_ILOCK_EXCL); + +reclaim: xfs_ireclaim(ip); return 0; } From owner-xfs@oss.sgi.com Mon Jan 14 04:14:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jan 2008 04:14:35 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.0 required=5.0 tests=BAYES_50,HTML_MESSAGE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0ECE5OH020406 for ; Mon, 14 Jan 2008 04:14:08 -0800 X-ASG-Debug-ID: 1200312863-2a3703ab0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wa-out-1112.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7BCC411CB10C for ; Mon, 14 Jan 2008 04:14:23 -0800 (PST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.181]) by cuda.sgi.com with ESMTP id Aw5yJcHf6Zo7Ia3e for ; Mon, 14 Jan 2008 04:14:23 -0800 (PST) Received: by wa-out-1112.google.com with SMTP id k22so3886730waf.18 for ; Mon, 14 Jan 2008 04:14:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=RiWCLQA+GUNeyZ8+SGYXV2IljzasS9e/u2DqpVFinKc=; b=c0D4ccojxLHOwcfe9wg6x7nN+0WnhHeWH5pcuW/A/awuGNyIAJgUjOPLLamscT+ElKKJWPzHF+xG1Xe5iKJNHB+0BS4AEh+DUnrQQOgQ61EmhDPM5Ie2F9YMlsMeJYuTex0ylEb79w3moAJYrg/xAmHWImfcmv6701AhBwOytDs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=CSP5KHEJT9Wv6S2BEERxsJDNF6romdwoGcpMZpsqZbSpI/orLqaFgl+/iC7bjqbrV66MIOdkgvwOTmSRptwemXoUrR5dEDZ6SDdV3DPSTnKEAvLsXW8RO3JKICS+lD4f+T820DSQf5khegUk6mXH39oJewYP9Xp/QFWWWkzoXSw= Received: by 10.114.112.1 with SMTP id k1mr1562910wac.24.1200312862315; Mon, 14 Jan 2008 04:14:22 -0800 (PST) Received: by 10.114.182.10 with HTTP; Mon, 14 Jan 2008 04:14:22 -0800 (PST) Message-ID: Date: Mon, 14 Jan 2008 17:44:22 +0530 From: "Gopala Krishna" To: xfs@oss.sgi.com X-ASG-Orig-Subj: Question related to XFS sync , especially fsync Subject: Question related to XFS sync , especially fsync MIME-Version: 1.0 X-Barracuda-Connect: wa-out-1112.google.com[209.85.146.181] X-Barracuda-Start-Time: 1200312863 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.08 X-Barracuda-Spam-Status: No, SCORE=-1.08 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=HTML_10_20, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39507 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message 0.94 HTML_10_20 BODY: Message is 10% to 20% HTML X-Virus-Scanned: ClamAV 0.91.2/5482/Sun Jan 13 13:43:51 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 2514 X-archive-position: 14115 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: gopalakrishna.n.m@gmail.com Precedence: bulk X-list: xfs Hi, I am seeing some strange problem with XFS and would like to know the expected behavior and if it is faulty is there any patches to resolve the problem. Problem: ====== Basically I am extracting metadata information for a given file by reading the inode structure from the particular disk offset (based on it's position calculated by published inode structure and super block structure information). Before reading the metada data information from the disk, I am calling fsync (I used to call sync, but later I changed to fsync, since sync is not guranteed to flush all meta data) to ensure all metadata related to file is flushed to disk. Later I am reading particular disk offset as per calculation. I am getting XFS magic field properly after mapping to XFs inode structure. However I am not getting dimode properly in some cases (not all cases) and it shows 00000 even for regular file and directory. It is happening only when I copy new file to XFS. But, when I unmount the file system and remount it, everything goes fine and I could get all expected meta data information and proper value for dimode (in the inode structure which indicates the type of the file, i.e regular directory etc.) . Once I mount it back and later even if I remove the same file and copy it back to XFS and then run my utility program, I could read mode information properly. But If I copy different file, again I could not get dimode properly. I have to unmount and remount to get the mode properly to make my utility program to display information properly. Once it starts getting proper mode value, it continues. So I am suspecting, even after calling fsync (which says it would block untill it flushes metadata information to disk ), is not really flushing. So only during unmount, it flushes metadata and hence I could get dimode properly. since after remounting , by reading metadata information , I could get mode properly and differentiate directory or regular file, and also it is filling magic etc. properly, I feel the data I am reading is right and that I could compare with stat system call and ls commands. If I am doing something wrong and no problem with XFS, then I should not get mode field properly even after unmount/remount operation. Is there any problem with XFS fsync? Why dimode is getting updated only during unmount? why not when I call fsync? Because fsync says it has to flush all meta dat to disk before existing. Please let me know your feedback. [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Mon Jan 14 04:24:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jan 2008 04:24:16 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.0 required=5.0 tests=BAYES_50,HTML_MESSAGE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0ECOAR1026029 for ; Mon, 14 Jan 2008 04:24:12 -0800 X-ASG-Debug-ID: 1200313467-652d006d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wa-out-1112.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0B7E911CB35E for ; Mon, 14 Jan 2008 04:24:27 -0800 (PST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by cuda.sgi.com with ESMTP id lszGxFExEGC15GBX for ; Mon, 14 Jan 2008 04:24:27 -0800 (PST) Received: by wa-out-1112.google.com with SMTP id k22so3891749waf.18 for ; Mon, 14 Jan 2008 04:24:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=/6UNSo5GlAFtr8IH2JVmy8a5xYjQ7sdeAlxMIKdmB8o=; b=LPuQ0PVSyNfy7p6jhs6zNezAkFgB3BCLJLwbEH/JvEzqTT51teZ2qgUol3sy/ab5Ud2CfT6FuDPn+5AGbP+Ww6/D9n29HQ2/60KQ7ctzkzsfS3Oal0KOQnNYoIIAlj/HVAK4ZyBj+8zRlas51jybw6uMcR9diHx1C9ugMdtwoc4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=xdEFZeTXSUgS9uTmxb+PWM+pffXddq+vs7O9muhBDulBR9/0l9cqHQJgyhBb/zSlii0s+6eoK7Ti7jt4m7xLlGX6b8mSHV6QJJx00MPLzfvvMeKVQov+DHwq9EgPGrfuVmQWoGTWUFwdXLGxyo0FzXjSiHlVtvUzelr/9Tavh+A= Received: by 10.114.77.1 with SMTP id z1mr1843846waa.56.1200313466878; Mon, 14 Jan 2008 04:24:26 -0800 (PST) Received: by 10.114.182.10 with HTTP; Mon, 14 Jan 2008 04:24:26 -0800 (PST) Message-ID: Date: Mon, 14 Jan 2008 17:54:26 +0530 From: "Gopala Krishna" To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Question related to XFS sync , especially fsync Subject: Re: Question related to XFS sync , especially fsync In-Reply-To: MIME-Version: 1.0 References: X-Barracuda-Connect: wa-out-1112.google.com[209.85.146.183] X-Barracuda-Start-Time: 1200313468 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39507 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/5482/Sun Jan 13 13:43:51 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 2919 X-archive-position: 14116 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: gopalakrishna.n.m@gmail.com Precedence: bulk X-list: xfs Hi, My system information: -bash-3.00# uname -a Linux XXXXX #1 SMP Thu May 17 14:00:09 UTC 2007 ia64 ia64 ia64 GNU/Linux -bash-3.00# cat /etc/issue Welcome to SUSE Linux Enterprise Server 10 SP1 (ia64) - Kernel \r (\l). Thanks, Gopal. On 1/14/08, Gopala Krishna wrote: > > Hi, > I am seeing some strange problem with XFS and would like to know the > expected behavior and if it is faulty is there any patches to resolve the > problem. > > Problem: > ====== > Basically I am extracting metadata information for a given file by reading > the inode structure from the particular disk offset (based on it's position > calculated by published inode structure and super block structure > information). Before reading the metada data information from the disk, I > am calling fsync (I used to call sync, but later I changed to fsync, since > sync is not guranteed to flush all meta data) to ensure all metadata > related to file is flushed to disk. Later I am reading particular disk > offset as per calculation. I am getting XFS magic field properly after > mapping to XFs inode structure. However I am not getting dimode properly in > some cases (not all cases) and it shows 00000 even for regular file and > directory. > > It is happening only when I copy new file to XFS. But, when I unmount the > file system and remount it, everything goes fine and I could get all > expected meta data information and proper value for dimode (in the inode > structure which indicates the type of the file, i.e regular directory > etc.) . > > Once I mount it back and later even if I remove the same file and copy it > back to XFS and then run my utility program, I could read mode information > properly. But If I copy different file, again I could not get dimode > properly. I have to unmount and remount to get the mode properly to make my > utility program to display information properly. Once it starts getting > proper mode value, it continues. > > So I am suspecting, even after calling fsync (which says it would block > untill it flushes metadata information to disk ), is not really flushing. So > only during unmount, it flushes metadata and hence I could get dimode > properly. since after remounting , by reading metadata information , I could > get mode properly and differentiate directory or regular file, and also it > is filling magic etc. properly, I feel the data I am reading is right and > that I could compare with stat system call and ls commands. > > If I am doing something wrong and no problem with XFS, then I should not > get mode field properly even after unmount/remount operation. > > Is there any problem with XFS fsync? Why dimode is getting updated only > during unmount? why not when I call fsync? Because fsync says it has to > flush all meta dat to disk before existing. > > Please let me know your feedback. > [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Mon Jan 14 04:32:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jan 2008 04:32:18 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.0 required=5.0 tests=BAYES_50,HTML_MESSAGE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0ECWEts026808 for ; Mon, 14 Jan 2008 04:32:16 -0800 X-ASG-Debug-ID: 1200313951-2ed202370000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wa-out-1112.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A252A11CB363 for ; Mon, 14 Jan 2008 04:32:31 -0800 (PST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by cuda.sgi.com with ESMTP id GATW0yIPbhqNQZmB for ; Mon, 14 Jan 2008 04:32:31 -0800 (PST) Received: by wa-out-1112.google.com with SMTP id k22so3895946waf.18 for ; Mon, 14 Jan 2008 04:32:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=C6oR7s7/ZJORwbHhhTuXUDtVTTGMvzR9PefSqsTowLY=; b=I6b9x0XBS1eAAUbKon5uR/+/5uJOXviOzI4YYiur36H3LQytk8teorGSh88qKKCKCa+7Momy8ML/iTj03YmPlDj0nvgTO3jX+La37jYKTWXbqlZ3vCNWa0iDVagu2zSXwsA8IwU4I213zfDCleC3QtXPJ9aic1o8c5xr6QbSKww= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=RWaC/xJpezozUj4Cfw1oz9r23GKjG0CxQTE1ZwkT/RkfLM33zSPjx8a92VfkyM3NM6H7HyYGMMANdhYV8oVaK/YheKT7GVExR/RjJAVNC881rSgDU3zQes8M+cbSrBtNjjrm8Mt3woY7m7hnzU2TR49OtSVGy+cXD2RMBtOzM74= Received: by 10.114.151.13 with SMTP id y13mr1954586wad.60.1200313550262; Mon, 14 Jan 2008 04:25:50 -0800 (PST) Received: by 10.114.182.10 with HTTP; Mon, 14 Jan 2008 04:25:50 -0800 (PST) Message-ID: Date: Mon, 14 Jan 2008 17:55:50 +0530 From: "Gopala Krishna" To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Question related to XFS sync , especially fsync Subject: Re: Question related to XFS sync , especially fsync In-Reply-To: MIME-Version: 1.0 References: X-Barracuda-Connect: wa-out-1112.google.com[209.85.146.183] X-Barracuda-Start-Time: 1200313951 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39507 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/5482/Sun Jan 13 13:43:51 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 3217 X-archive-position: 14117 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: gopalakrishna.n.m@gmail.com Precedence: bulk X-list: xfs One more information: XFS is not a root file system , but EXT3 is a root file system. Thanks, Gopal. On 1/14/08, Gopala Krishna wrote: > > Hi, > My system information: > -bash-3.00# uname -a > Linux XXXXX #1 SMP Thu May 17 14:00:09 UTC 2007 ia64 ia64 ia64 > GNU/Linux > > -bash-3.00# cat /etc/issue > Welcome to SUSE Linux Enterprise Server 10 SP1 (ia64) - Kernel \r (\l). > > Thanks, > Gopal. > > On 1/14/08, Gopala Krishna wrote: > > > > Hi, > > I am seeing some strange problem with XFS and would like to know the > > expected behavior and if it is faulty is there any patches to resolve the > > problem. > > > > Problem: > > ====== > > Basically I am extracting metadata information for a given file by > > reading the inode structure from the particular disk offset (based on > > it's position calculated by published inode structure and super block > > structure information). Before reading the metada data information from the > > disk, I am calling fsync (I used to call sync, but later I changed to fsync, > > since sync is not guranteed to flush all meta data) to ensure all metadata > > related to file is flushed to disk. Later I am reading particular disk > > offset as per calculation. I am getting XFS magic field properly after > > mapping to XFs inode structure. However I am not getting dimode properly in > > some cases (not all cases) and it shows 00000 even for regular file and > > directory. > > > > It is happening only when I copy new file to XFS. But, when I unmount > > the file system and remount it, everything goes fine and I could get all > > expected meta data information and proper value for dimode (in the inode > > structure which indicates the type of the file, i.e regular directory > > etc.) . > > > > Once I mount it back and later even if I remove the same file and copy > > it back to XFS and then run my utility program, I could read mode > > information properly. But If I copy different file, again I could not get > > dimode properly. I have to unmount and remount to get the mode properly to > > make my utility program to display information properly. Once it starts > > getting proper mode value, it continues. > > > > So I am suspecting, even after calling fsync (which says it would block > > untill it flushes metadata information to disk ), is not really flushing. So > > only during unmount, it flushes metadata and hence I could get dimode > > properly. since after remounting , by reading metadata information , I could > > get mode properly and differentiate directory or regular file, and also it > > is filling magic etc. properly, I feel the data I am reading is right and > > that I could compare with stat system call and ls commands. > > > > If I am doing something wrong and no problem with XFS, then I should not > > get mode field properly even after unmount/remount operation. > > > > Is there any problem with XFS fsync? Why dimode is getting updated only > > during unmount? why not when I call fsync? Because fsync says it has to > > flush all meta dat to disk before existing. > > > > Please let me know your feedback. > > > > [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Mon Jan 14 05:23:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jan 2008 05:23:39 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: **** X-Spam-Status: No, score=4.4 required=5.0 tests=BAYES_50,HTML_MESSAGE, MIME_QP_LONG_LINE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0EDNWcw031023 for ; Mon, 14 Jan 2008 05:23:35 -0800 X-ASG-Debug-ID: 1200317027-193f00210000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from imo-m20.mx.aol.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 60CA7517774 for ; Mon, 14 Jan 2008 05:23:47 -0800 (PST) Received: from imo-m20.mx.aol.com (imo-m20.mx.aol.com [64.12.137.1]) by cuda.sgi.com with ESMTP id GNnzXCEHvkgUxIV8 for ; Mon, 14 Jan 2008 05:23:47 -0800 (PST) Received: from AndrewL733@aol.com by imo-m20.mx.aol.com (mail_out_v38_r9.3.) id 4.c1d.2dedc8d5 (37120) for ; Mon, 14 Jan 2008 08:23:44 -0500 (EST) Received: from WEBMAIL-DG08 (webmail-dg08.sim.aol.com [205.188.171.72]) by cia-ma01.mx.aol.com (v121.4) with ESMTP id MAILCIAMA016-9100478b6260301; Mon, 14 Jan 2008 08:23:44 -0500 To: xfs@oss.sgi.com X-ASG-Orig-Subj: Optimal mkfs settings for md RAID0 over 2x3ware RAIDS Subject: Optimal mkfs settings for md RAID0 over 2x3ware RAIDS Date: Mon, 14 Jan 2008 08:23:44 -0500 X-MB-Message-Source: WebUI X-AOL-IP: 207.180.154.47 X-MB-Message-Type: User MIME-Version: 1.0 From: andrewl733@aol.com X-Mailer: AOL Webmail 33706-STANDARD Received: from 207.180.154.47 by WEBMAIL-DG08.sysops.aol.com (205.188.171.72) with HTTP (WebMailUI); Mon, 14 Jan 2008 08:23:44 -0500 Message-Id: <8CA24C7D24953CD-93C-29C2@WEBMAIL-DG08.sysops.aol.com> X-Barracuda-Connect: imo-m20.mx.aol.com[64.12.137.1] X-Barracuda-Start-Time: 1200317030 X-Barracuda-Bayes: INNOCENT GLOBAL 0.5000 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.95 X-Barracuda-Spam-Status: No, SCORE=0.95 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=BSF_SC0_SA085b, HTML_MESSAGE, NO_REAL_NAME, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39507 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.55 NO_REAL_NAME From: does not include a real name 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 0.40 BSF_SC0_SA085b URI: Custom Rule SA085b 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/5482/Sun Jan 13 13:43:51 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1234 X-archive-position: 14118 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: andrewl733@aol.com Precedence: bulk X-list: xfs Hello XFS list, I am trying to figure out the optimal mkfs settings for a large array (i.e.= , 18 TB) consisting of 2 or 4 PHYSICAL 3ware RAID-5 arrays striped together= with Linux software RAID-0. As far as I can tell, this question about comb= ining physical and software RAID has not been asked or answered on the list= .=20 As I understand it, for a SINGLE 12-drive 3ware PHYSICAL Hardware RAID-5 cr= eated with a 3-ware-defined "stripe size" of 64K, the optimal mkfs setting = should be:=20 mkfs.xfs =E2=80=93d=C2=A0 su=3D64k,sw=3D11 /dev/sdX The question is, what is optimal if I stripe together TWO of these Physical= Hardware RAID-5 arrays as a SOFTWARE RAID-0. Casual testing shows striping= together two PHYSICAL RAIDS as sucn can yield a gain in performance of app= roximately 60 percent versus 12-drives. But in order to optimize the RAID-0= device, would the correct mkfs be:=20 mkfs.xfs -d su=3D64k,sw=3D22 /dev/mdX There are now 24 drives minus two for parity. Is the logic correct here?=20 Regards,=20 Andrew ________________________________________________________________________ More new features than ever. Check out the new AOL Mail ! - http://webmail= .aol.com [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Mon Jan 14 06:06:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jan 2008 06:06:25 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0EE6I9P002187 for ; Mon, 14 Jan 2008 06:06:19 -0800 X-ASG-Debug-ID: 1200319595-344a00450000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.suse.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 06191517AFB for ; Mon, 14 Jan 2008 06:06:35 -0800 (PST) Received: from mx1.suse.de (mx1.suse.de [195.135.220.2]) by cuda.sgi.com with ESMTP id PhWCzEe99HVcEuNR for ; Mon, 14 Jan 2008 06:06:35 -0800 (PST) X-ASG-Whitelist: Client Received: from Relay1.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id DA37A26513; Mon, 14 Jan 2008 15:06:32 +0100 (CET) To: "Gopala Krishna" Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Question related to XFS sync , especially fsync Subject: Re: Question related to XFS sync , especially fsync From: Andi Kleen References: Date: Mon, 14 Jan 2008 15:06:32 +0100 In-Reply-To: (Gopala Krishna's message of "Mon\, 14 Jan 2008 17\:44\:22 +0530") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Barracuda-Connect: mx1.suse.de[195.135.220.2] X-Barracuda-Start-Time: 1200319596 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/5482/Sun Jan 13 13:43:51 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14119 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: andi@firstfloor.org Precedence: bulk X-list: xfs "Gopala Krishna" writes: > ====== > Basically I am extracting metadata information for a given file by reading > the inode structure from the particular disk offset (based on it's position > calculated by published inode structure and super block structure > information). Before reading the metada data information from the disk, I > am calling fsync (I used to call sync, but later I changed to fsync, since > sync is not guranteed to flush all meta data) sync is guaranteed to flush all metadata. But it has other problems like livelocks. to ensure all metadata > related to file is flushed to disk. Later I am reading particular disk > offset as per calculation. I am getting XFS magic field properly after > mapping to XFs inode structure. However I am not getting dimode properly in > some cases (not all cases) and it shows 00000 even for regular file and > directory. I suspect it's flushed to the log only. You could probably write some other metadata until the log is completely full and fsync it, then eventually the first change should be guaranteed to be flushed to the rest of the disk. > If I am doing something wrong Well yes it sounds certainly weird what you're attempting. -Andi From owner-xfs@oss.sgi.com Mon Jan 14 06:30:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jan 2008 06:31:01 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,MIME_8BIT_HEADER autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0EEUuAL004067 for ; Mon, 14 Jan 2008 06:30:57 -0800 X-ASG-Debug-ID: 1200321072-330700ea0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from orchid.cbk.poznan.pl (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DB06311CC064 for ; Mon, 14 Jan 2008 06:31:13 -0800 (PST) Received: from orchid.cbk.poznan.pl (cbk-gw.man.poznan.pl [150.254.210.225]) by cuda.sgi.com with ESMTP id c1JUkHVdW1IRbPQx for ; Mon, 14 Jan 2008 06:31:13 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by orchid.cbk.poznan.pl (Postfix) with ESMTP id 7E368E49957; Mon, 14 Jan 2008 15:31:11 +0100 (CET) X-Virus-Scanned: ClamAV 0.91.2/5482/Sun Jan 13 13:43:51 2008 on oss.sgi.com X-Virus-Scanned: by amavisd-new at cbk.poznan.pl Received: from orchid.cbk.poznan.pl ([127.0.0.1]) by localhost (orchid.cbk.poznan.pl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 9UDOTPRJXlF4; Mon, 14 Jan 2008 15:31:10 +0100 (CET) Received: from venus.local.navi.pl (ip-83-238-212-180.netia.com.pl [83.238.212.180]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by orchid.cbk.poznan.pl (Postfix) with ESMTP id 7FE59E4984D; Mon, 14 Jan 2008 15:31:10 +0100 (CET) X-ASG-Orig-Subj: Re: Question related to XFS sync , especially fsync Subject: Re: Question related to XFS sync , especially fsync From: Olaf =?iso-8859-2?Q?Fr=B1czyk?= To: Gopala Krishna Cc: xfs@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Date: Mon, 14 Jan 2008 15:32:32 +0100 Message-Id: <1200321152.10994.13.camel@venus.local.navi.pl> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 7bit X-Barracuda-Connect: cbk-gw.man.poznan.pl[150.254.210.225] X-Barracuda-Start-Time: 1200321073 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39507 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Status: Clean X-archive-position: 14120 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: olaf@cbk.poznan.pl Precedence: bulk X-list: xfs On Mon, 2008-01-14 at 17:44 +0530, Gopala Krishna wrote: > So I am suspecting, even after calling fsync (which says it would block > untill it flushes metadata information to disk ), is not really flushing. So > only during unmount, it flushes metadata and hence I could get dimode > properly. since after remounting , by reading metadata information , I could > get mode properly and differentiate directory or regular file, and also it > is filling magic etc. properly, I feel the data I am reading is right and > that I could compare with stat system call and ls commands. The metadata are put in log. So they are on disk. Just not in the place you expect them to find. > > If I am doing something wrong and no problem with XFS, then I should not get > mode field properly even after unmount/remount operation. At remount the log is replayed and the metadata are in the place where you expect them to be. > > Is there any problem with XFS fsync? Why dimode is getting updated only > during unmount? why not when I call fsync? Because fsync says it has to > flush all meta dat to disk before existing. And it does. It is not XFS problem. It is your problem ;) BTW, the GRUB does similiar thing. And many people reported problems about it. Regards, Olaf From owner-xfs@oss.sgi.com Mon Jan 14 06:42:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jan 2008 06:43:01 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_50,MISSING_MIMEOLE autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0EEgvGZ005222 for ; Mon, 14 Jan 2008 06:42:58 -0800 X-ASG-Debug-ID: 1200321794-330701060000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from enyo.dsw2k3.info (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8566511CC1A7 for ; Mon, 14 Jan 2008 06:43:15 -0800 (PST) Received: from enyo.dsw2k3.info (enyo.dsw2k3.info [195.71.86.239]) by cuda.sgi.com with ESMTP id iKQgFKdK6yKO09D7 for ; Mon, 14 Jan 2008 06:43:15 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by enyo.dsw2k3.info (Postfix) with ESMTP id 0E8342BEA7; Mon, 14 Jan 2008 15:43:13 +0100 (CET) X-Virus-Scanned: ClamAV 0.91.2/5482/Sun Jan 13 13:43:51 2008 on oss.sgi.com X-Virus-Scanned: Debian amavisd-new at enyo.dsw2k3.info Received: from enyo.dsw2k3.info ([127.0.0.1]) by localhost (enyo.dsw2k3.info [127.0.0.1]) (amavisd-new, port 10024) with LMTP id MF+KORdsxO0C; Mon, 14 Jan 2008 15:43:10 +0100 (CET) Received: from citd.de (p4FC4D3E2.dip.t-dialin.net [79.196.211.226]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by enyo.dsw2k3.info (Postfix) with ESMTP id DDCBD2BEA3; Mon, 14 Jan 2008 15:43:09 +0100 (CET) Date: Mon, 14 Jan 2008 15:43:06 +0100 From: Matthias Schniedermeyer To: Gopala Krishna Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Question related to XFS sync , especially fsync Subject: ***** SUSPECTED SPAM ***** Re: Question related to XFS sync , especially fsync Message-ID: <20080114144306.GA4672@citd.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-12-11) X-Barracuda-Connect: enyo.dsw2k3.info[195.71.86.239] X-Barracuda-Start-Time: 1200321795 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-ASG-Tag: HEADER (^X-Barracuda-Connect: .*\.info\[.*) X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39507 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Priority: 5 (Lowest) X-MSMail-Priority: Low Importance: Low X-Barracuda-Spam-Flag: YES X-Virus-Status: Clean X-archive-position: 14121 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ms@citd.de Precedence: bulk X-list: xfs On 14.01.2008 17:44, Gopala Krishna wrote: > Hi, > I am seeing some strange problem with XFS and would like to know the > expected behavior and if it is faulty is there any patches to resolve the > problem. > > Problem: > ====== ... The man-page "xfs_freeze" at least reads like it does what you want, i.e. it flushes everything(tm). Bis denn -- Real Programmers consider "what you see is what you get" to be just as bad a concept in Text Editors as it is in women. No, the Real Programmer wants a "you asked for it, you got it" text editor -- complicated, cryptic, powerful, unforgiving, dangerous. From owner-xfs@oss.sgi.com Mon Jan 14 09:37:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jan 2008 09:37:35 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0EHbRUq021176 for ; Mon, 14 Jan 2008 09:37:31 -0800 X-ASG-Debug-ID: 1200332262-193f024a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 692A351918F for ; Mon, 14 Jan 2008 09:37:43 -0800 (PST) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 2WpWnjSg9CbfbWQU for ; Mon, 14 Jan 2008 09:37:43 -0800 (PST) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m0EHbbF3014300 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 14 Jan 2008 18:37:37 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m0EHbaBg014298 for xfs@oss.sgi.com; Mon, 14 Jan 2008 18:37:36 +0100 Date: Mon, 14 Jan 2008 18:37:36 +0100 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] fix XFSQA #184 for multiple invocations Subject: [PATCH] fix XFSQA #184 for multiple invocations Message-ID: <20080114173736.GA14234@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1200332265 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39509 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5483/Mon Jan 14 06:45:01 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14122 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Make sure the device node is removed before creating it to allow running the testcase multiple times without recreating the filesystem. Signed-off-by: Christoph Hellwig Index: xfstests/184 =================================================================== RCS file: /cvs/xfs-cmds/xfstests/184,v retrieving revision 1.1 diff -u -p -r1.1 184 --- xfstests/184 19 Dec 2007 05:14:33 -0000 1.1 +++ xfstests/184 12 Jan 2008 13:57:26 -0000 @@ -35,6 +35,7 @@ _supported_os IRIX Linux _setup_testdir +rm -f $testdir/null mknod $testdir/null c 1 3 chmod 666 $testdir/null echo fred > $testdir/null From owner-xfs@oss.sgi.com Mon Jan 14 10:01:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jan 2008 10:01:59 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0EI1qBF023049 for ; Mon, 14 Jan 2008 10:01:53 -0800 X-ASG-Debug-ID: 1200333730-3463025e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp124.sbc.mail.sp1.yahoo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 87933519480 for ; Mon, 14 Jan 2008 10:02:10 -0800 (PST) Received: from smtp124.sbc.mail.sp1.yahoo.com (smtp124.sbc.mail.sp1.yahoo.com [69.147.64.97]) by cuda.sgi.com with SMTP id 1hIQGV53xgnC0IFF for ; Mon, 14 Jan 2008 10:02:10 -0800 (PST) Received: (qmail 75333 invoked from network); 14 Jan 2008 17:55:30 -0000 Received: from unknown (HELO stupidest.org) (cwedgwood@sbcglobal.net@24.5.75.45 with login) by smtp124.sbc.mail.sp1.yahoo.com with SMTP; 14 Jan 2008 17:55:30 -0000 X-YMail-OSG: t1FDUcwVM1lPutFGiqBoCP5y6y6CmEueaCaYRdv3YArtyzZPL8XLacUGnjgUv5Wf5RK7SPVQfQ-- Received: by tuatara.stupidest.org (Postfix, from userid 10000) id C03712839783; Mon, 14 Jan 2008 09:55:53 -0800 (PST) Date: Mon, 14 Jan 2008 09:55:53 -0800 From: Chris Wedgwood To: Gopala Krishna Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Question related to XFS sync , especially fsync Subject: Re: Question related to XFS sync , especially fsync Message-ID: <20080114175553.GA3711@puku.stupidest.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Barracuda-Connect: smtp124.sbc.mail.sp1.yahoo.com[69.147.64.97] X-Barracuda-Start-Time: 1200333730 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39510 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5483/Mon Jan 14 06:45:01 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14123 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: cw@f00f.org Precedence: bulk X-list: xfs On Mon, Jan 14, 2008 at 05:44:22PM +0530, Gopala Krishna wrote: > Is there any problem with XFS fsync? Why dimode is getting updated > only during unmount? why not when I call fsync? Because fsync says > it has to flush all meta dat to disk before existing. it's probably in the log if you must poke about under the fs like this, try doing freeze/unfreeze (this is what i suggested to the grub people years ago, but i'm not sure it ever made it upstream) From owner-xfs@oss.sgi.com Mon Jan 14 10:05:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jan 2008 10:05:41 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0EI5ZF2023586 for ; Mon, 14 Jan 2008 10:05:36 -0800 X-ASG-Debug-ID: 1200333952-3182015b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail3.key-systems.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id DF64C5194D9 for ; Mon, 14 Jan 2008 10:05:53 -0800 (PST) Received: from mail3.key-systems.net (mail3.key-systems.net [81.3.43.213]) by cuda.sgi.com with SMTP id YL9yS3c5tSVJ3fFC for ; Mon, 14 Jan 2008 10:05:53 -0800 (PST) Received: (qmail 27606 invoked from network); 14 Jan 2008 18:05:13 -0000 Received: from ppp-62-245-211-18.dynamic.mnet-online.de (HELO [62.245.211.18]) (62.245.211.18) by mail3.key-systems.net (qpsmtpd/0.31.1) with ESMTP; Mon, 14 Jan 2008 18:05:13 +0000 X-ASG-Orig-Subj: binary NULL errors Subject: binary NULL errors From: Christoph Anton Mitterer To: xfs@oss.sgi.com Content-Type: text/plain Date: Mon, 14 Jan 2008 19:05:49 +0100 Message-Id: <1200333949.3145.33.camel@fermat.scientia.net> Mime-Version: 1.0 X-Mailer: Evolution 2.12.2 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: mail3.key-systems.net[81.3.43.213] X-Barracuda-Start-Time: 1200333953 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39510 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5483/Mon Jan 14 06:45:01 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14124 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: calestyo@scientia.net Precedence: bulk X-list: xfs Hi. I've got some questions about using XFS. I've already used it as for all my discs about one or two years ago, but then I've suffered several times from the binary NULLs "bug", that happened when the system crashed or had a power loss. I've lost more than one open files (like all my bookmarks in Firefox) and thus I've switched back to ext3 In the FAQ at http://oss.sgi.com/projects/xfs/faq.html it says: Update: This issue has been addressed with a CVS fix on the 29th March 2007 and merged into mainline on 8th May 2007 for 2.6.22-rc1. What does this exactly mean and what has been fixed/addressed? Is XFS now similar to ext3 and I won't see those binary NULLs stuff again? What happens now in case of a powerloss? Does XFS still make heavy use of caching techniques? Best wishes, Chris, From owner-xfs@oss.sgi.com Mon Jan 14 14:42:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jan 2008 14:42:44 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0EMgaQ4029308 for ; Mon, 14 Jan 2008 14:42:40 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id JAA08303; Tue, 15 Jan 2008 09:42:49 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0EMglLF25207878; Tue, 15 Jan 2008 09:42:48 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0EMgjfK25215776; Tue, 15 Jan 2008 09:42:45 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Tue, 15 Jan 2008 09:42:45 +1100 From: David Chinner To: Gopala Krishna Cc: xfs@oss.sgi.com Subject: Re: Question related to XFS sync , especially fsync Message-ID: <20080114224245.GT155259@sgi.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5483/Mon Jan 14 06:45:01 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14125 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Mon, Jan 14, 2008 at 05:44:22PM +0530, Gopala Krishna wrote: > Hi, > I am seeing some strange problem with XFS and would like to know the > expected behavior and if it is faulty is there any patches to resolve the > problem. > > Problem: > ====== > Basically I am extracting metadata information for a given file by reading > the inode structure from the particular disk offset (based on it's position > calculated by published inode structure and super block structure > information). Before reading the metada data information from the disk, I > am calling fsync (I used to call sync, but later I changed to fsync, since > sync is not guranteed to flush all meta data) to ensure all metadata > related to file is flushed to disk. Later I am reading particular disk > offset as per calculation. I am getting XFS magic field properly after > mapping to XFs inode structure. However I am not getting dimode properly in > some cases (not all cases) and it shows 00000 even for regular file and > directory. How are you finding and reading the inode off disk? Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Mon Jan 14 14:55:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jan 2008 14:55:54 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0EMth5e030814 for ; Mon, 14 Jan 2008 14:55:50 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id JAA08745; Tue, 15 Jan 2008 09:55:56 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0EMtsLF25204375; Tue, 15 Jan 2008 09:55:55 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0EMtqem25218084; Tue, 15 Jan 2008 09:55:52 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Tue, 15 Jan 2008 09:55:52 +1100 From: David Chinner To: andrewl733@aol.com Cc: xfs@oss.sgi.com Subject: Re: Optimal mkfs settings for md RAID0 over 2x3ware RAIDS Message-ID: <20080114225552.GU155259@sgi.com> References: <8CA24C7D24953CD-93C-29C2@WEBMAIL-DG08.sysops.aol.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8CA24C7D24953CD-93C-29C2@WEBMAIL-DG08.sysops.aol.com> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5483/Mon Jan 14 06:45:01 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14126 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Mon, Jan 14, 2008 at 08:23:44AM -0500, andrewl733@aol.com wrote: > Hello XFS list, > > I am trying to figure out the optimal mkfs settings for a large > array (i.e., 18 TB) consisting of 2 or 4 PHYSICAL 3ware RAID-5 > arrays striped together with Linux software RAID-0. As far as I > can tell, this question about combining physical and software RAID > has not been asked or answered on the list. > As I understand it, for a SINGLE 12-drive 3ware PHYSICAL Hardware > RAID-5 created with a 3-ware-defined "stripe size" of 64K, the > optimal mkfs setting should be: . > > mkfs.xfs -d su=64k,sw=11 /dev/sdX > > The question is, what is optimal if I stripe together TWO of these > Physical Hardware RAID-5 arrays as a SOFTWARE RAID-0. Casual > testing shows striping together two PHYSICAL RAIDS as sucn can > yield a gain in performance of approximately 60 percent versus > 12-drives. But in order to optimize the RAID-0 device, would the > correct mkfs be: > > mkfs.xfs -d su=64k,sw=22 /dev/mdX > > There are now 24 drives minus two for parity. Is the logic correct here? Depends on your workload and file mix. For lots of small files, the above will work fine. For maximum bandwidth, it will suck. For maximum bandwidth you want XFS to align to the start of a RAID5 lun and do full RAID5 stripe width allocations so that large allocations do not partially overlap RAID5 luns. i.e. with what you suggested, an allocation of 22x64k (full filesystem stripe width) will only be aligned to the underlying hardware in 2 of the possible 22 places it could be allocated with a 64k alignment. in the other 20 cases, you'll get one full RAID5 write to one lun, and two sets of partial RMW cycles to the other lun because they are not full RAID5 stripe writes. That will be slow. With su=11*64k,sw=2, a 22x64k allocation will always be aligned to the underlying geometry (until you start to run out of space) and hence both luns will do a full RAID5 stripe write and it will be fast. Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Mon Jan 14 15:17:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jan 2008 15:17:51 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0ENHfb2000685 for ; Mon, 14 Jan 2008 15:17:44 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id KAA09501; Tue, 15 Jan 2008 10:17:54 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0ENHrLF24274454; Tue, 15 Jan 2008 10:17:53 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0ENHpoS25220828; Tue, 15 Jan 2008 10:17:51 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Tue, 15 Jan 2008 10:17:51 +1100 From: David Chinner To: Christoph Anton Mitterer Cc: xfs@oss.sgi.com Subject: Re: binary NULL errors Message-ID: <20080114231751.GV155259@sgi.com> References: <1200333949.3145.33.camel@fermat.scientia.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1200333949.3145.33.camel@fermat.scientia.net> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5483/Mon Jan 14 06:45:01 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14127 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Mon, Jan 14, 2008 at 07:05:49PM +0100, Christoph Anton Mitterer wrote: > In the FAQ at http://oss.sgi.com/projects/xfs/faq.html it says: > Update: This issue has been addressed with a CVS fix on the 29th March > 2007 and merged into mainline on 8th May 2007 for 2.6.22-rc1. > > What does this exactly mean and what has been fixed/addressed? It means exactly what it says - that the problem has been fixed if you use 2.6.22 or more recent. If you want details, start looking here: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ba87ea699ebd9dd577bf055ebc4a98200e337542 > Is XFS now similar to ext3 and I won't see those binary NULLs stuff > again? Yes, It will behave the same as ext3 - either you'll have a good file or you'll see a zero length file (because the application doesn't overwrite safely). > What happens now in case of a powerloss? Same thing as always happens on power loss - you lose whatever is in memory. We're just more careful about how we update stuff on disk now. > Does XFS still make heavy use > of caching techniques? Yes, just like every other linux filesystem ;) Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Mon Jan 14 19:02:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jan 2008 19:02:16 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: **** X-Spam-Status: No, score=4.8 required=5.0 tests=AWL,BAYES_50,HTML_MESSAGE, J_CHICKENPOX_43,MISSING_MIMEOLE,RCVD_IN_PSBL autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0F328Hw017814 for ; Mon, 14 Jan 2008 19:02:11 -0800 X-ASG-Debug-ID: 1200366144-7ddf01b50002-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from imo-m12.mail.aol.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9D3EC51C767 for ; Mon, 14 Jan 2008 19:02:25 -0800 (PST) Received: from imo-m12.mail.aol.com (imo-m12.mx.aol.com [64.12.143.100]) by cuda.sgi.com with ESMTP id k7YRS6ZvtCxmE1va for ; Mon, 14 Jan 2008 19:02:25 -0800 (PST) X-ASG-RBL-Restriction: psbl.surriel.com Received: from AndrewL733@aol.com by imo-m12.mx.aol.com (mail_out_v38_r9.3.) id 5.ce5.25f90ac6 (37032); Mon, 14 Jan 2008 22:02:16 -0500 (EST) Received: from WEBMAIL-MC03 (webmail-mc03.webmail.aol.com [64.12.170.80]) by cia-db02.mx.aol.com (v121.4) with ESMTP id MAILCIADB022-90a8478c223726a; Mon, 14 Jan 2008 22:02:15 -0500 References: <8CA24C7D24953CD-93C-29C2@WEBMAIL-DG08.sysops.aol.com> <20080114225552.GU155259@sgi.com> To: dgc@sgi.com X-ASG-Orig-Subj: Re: Optimal mkfs settings for md RAID0 over 2x3ware RAIDS Subject: ***** SUSPECTED SPAM ***** Re: Optimal mkfs settings for md RAID0 over 2x3ware RAIDS Date: Mon, 14 Jan 2008 22:02:16 -0500 X-AOL-IP: 207.180.154.47 In-Reply-To: <20080114225552.GU155259@sgi.com> X-MB-Message-Source: WebUI Received: from 207.180.154.47 by WEBMAIL-MC03.sysops.aol.com (64.12.170.80) with HTTP (WebMailUI); Mon, 14 Jan 2008 22:02:16 -0500 MIME-Version: 1.0 From: andrewl733@aol.com X-MB-Message-Type: User X-Mailer: AOL Webmail 33706-STANDARD Cc: xfs@oss.sgi.com Message-Id: <8CA253A2B251FC3-F4C-1FFE@WEBMAIL-MC03.sysops.aol.com> X-Barracuda-Connect: imo-m12.mx.aol.com[64.12.143.100] X-Barracuda-Start-Time: 1200366146 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-ASG-Tag: RBL (psbl.surriel.com ) X-Barracuda-Spam-Score: -0.79 X-Barracuda-Spam-Status: No, SCORE=-0.79 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=BSF_SC0_SA085b, HTML_MESSAGE, MAILTO_TO_SPAM_ADDR, NO_REAL_NAME, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39547 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.55 NO_REAL_NAME From: does not include a real name 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 0.28 MAILTO_TO_SPAM_ADDR URI: Includes a link to a likely spammer email 0.40 BSF_SC0_SA085b URI: Custom Rule SA085b 0.00 HTML_MESSAGE BODY: HTML included in message X-Priority: 5 (Lowest) X-MSMail-Priority: Low Importance: Low X-Barracuda-Spam-Flag: YES X-Virus-Scanned: ClamAV 0.91.2/5483/Mon Jan 14 06:45:01 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 3111 X-archive-position: 14128 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: andrewl733@aol.com Precedence: bulk X-list: xfs Thanks for your speedy reply. Please see a follow up question below. On Mon, Jan 14, 2008 at 08:23:44AM -0500, andrewl733@aol.com wrote: > Hello XFS list, > > I am trying to figure out the optimal mkfs settings for a large > array (i.e., 18 TB) consisting of 2 or 4 PHYSICAL 3ware RAID-5 > arrays striped together with Linux software RAID-0. As far as I > can tell, this question about combining physical and software RAID > has not been asked or answered on the list. > As I understand it, for a SINGLE 12-drive 3ware PHYSICAL Hardware > RAID-5 created with a 3-ware-defined "stripe size" of 64K, the > optimal mkfs setting should be: . > > mkfs.xfs -d su=64k,sw=11 /dev/sdX > > The question is, what is optimal if I stripe together TWO of these > Physical Hardware RAID-5 arrays as a SOFTWARE RAID-0. Casual > testing shows striping together two PHYSICAL RAIDS as sucn can > yield a gain in performance of approximately 60 percent versus > 12-drives. But in order to optimize the RAID-0 device, would the > correct mkfs be: > > mkfs.xfs -d su=64k,sw=22 /dev/mdX > > There are now 24 drives minus two for parity. Is the logic correct here? Depends on your workload and file mix. For lots of small files, the above will work fine. For maximum bandwidth, it will suck. For maximum bandwidth you want XFS to align to the start of a RAID5 lun and do full RAID5 stripe width allocations so that large allocations do not partially overlap RAID5 luns. i.e. with what you suggested, an allocation of 22x64k (full filesystem stripe width) will only be aligned to the underlying hardware in 2 of the possible 22 places it could be allocated with a 64k alignment. in the other 20 cases, you'll get one full RAID5 write to one lun, and two sets of partial RMW cycles to the other lun because they are not full RAID5 stripe writes. That will be slow. With su=11*64k,sw=2, a 22x64k allocation will always be aligned to the underlying geometry (until you start to run out of space) and hence both luns will do a full RAID5 stripe write and it will be fast. In fact, I am testing a 64-drive SAS array today -- 4 x 16-drive RAID-5 arrays striped together with Linux RAID-0.? By your instructions, I should do mkfs as follows: mkfs.xfs -d su=960k,sw=4? /dev/mdX?? where su=15*64k However, I get back the following message: mkfs.xfs:? Specified data stripe unit 1920 is not the same as the volume stripe unit 512 mkfs.xfs:? Specified data stripe width 7680 is not the same as the volume stripe width 2048 The filesystem gets created. What's wrong here? In this case I have chosen to use a Linux md RAID-0 "chunk size" of 256k.? I get a similar message (with different numbers, of course) if I use a "chunk size" of 64k.? Is there an optimal ratio of 3ware "stripe size" to Linux md "chunk size" that also must come into play here? Thanks again in advance. Andrew Cheers, Dave. ________________________________________________________________________ More new features than ever. Check out the new AOL Mail ! - http://webmail.aol.com [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Tue Jan 15 05:51:05 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 05:51:09 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.9 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE, MIME_8BIT_HEADER autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0FDp46W020069 for ; Tue, 15 Jan 2008 05:51:05 -0800 X-ASG-Debug-ID: 1200405076-3a2c02df0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wa-out-1112.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 00E0711CF87D for ; Tue, 15 Jan 2008 05:51:16 -0800 (PST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by cuda.sgi.com with ESMTP id 13ZRrErkzFP2ryeZ for ; Tue, 15 Jan 2008 05:51:16 -0800 (PST) Received: by wa-out-1112.google.com with SMTP id k22so4602580waf.18 for ; Tue, 15 Jan 2008 05:51:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=OeBJfGKizAzrG0oHGgMrIMcO7PvwiuF4EuTH1JRjwJA=; b=p63cbDlDXsiZFYnML2dvY8whsl65CDk4l98AsQFOARi4fR/Y43LpX3uvlcCu9tpDkjd2JiTFsEQG/h2BBUB6ifbp793ddahCRrnaKtEFA52TfR1NdZDlnGyLiBJ6dJGtM2aHeiMhBGDoTYgrUxwaDd0x+PUeXjRPiHXMhXkkQWw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=ayhYamzaonH9lOy/AYpydlAl1K+YRYmd6EnNu5yTAjhshWDYeHWvu/91BVCNnhHAhdYTH8vdSoD/z/mHLg3jRs25+zxX1+eMhoAEmYYg5KtD/un5E6O8M/NRfBNH1QNTxVAozOgzHCieif2MpSpsAANdZrAAFNv0UCZeK5WckxA= Received: by 10.115.79.1 with SMTP id g1mr1340688wal.2.1200404652452; Tue, 15 Jan 2008 05:44:12 -0800 (PST) Received: by 10.114.182.4 with HTTP; Tue, 15 Jan 2008 05:44:12 -0800 (PST) Message-ID: Date: Tue, 15 Jan 2008 19:14:12 +0530 From: "Gopala Krishna" To: "David Chinner" , "Chris Wedgwood" , "Matthias Schniedermeyer" , "=?ISO-8859-2?Q?Olaf_Fr=B1czyk?=" , "Andi Kleen" X-ASG-Orig-Subj: Re: Question related to XFS sync , especially fsync Subject: Re: Question related to XFS sync , especially fsync Cc: xfs@oss.sgi.com In-Reply-To: <20080114224245.GT155259@sgi.com> MIME-Version: 1.0 References: <20080114224245.GT155259@sgi.com> X-Barracuda-Connect: wa-out-1112.google.com[209.85.146.178] X-Barracuda-Start-Time: 1200405082 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39590 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/5483/Mon Jan 14 06:45:01 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 2311 X-archive-position: 14129 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: gopalakrishna.n.m@gmail.com Precedence: bulk X-list: xfs Hi All, Thanks a lot for your response. I never thought it might be in a log and not flushed to disk. Very good clue. >>>It is not XFS problem. It is your problem ;) Good comment. Agreed : -). >>How are you finding and inode off disk I have lot of code getting in to that. To explain that I have to go through that complex part of the code to explain in detail. Basically once we get indoe number for a given file from the available system call, we only depending upon the XFS layout and it's structure. We are reading super block from a particular disk offset and calculating address for inode offset and its address on the disk and reading directly from the disk offset. We are totally depending on XFS on disk layout. To get very much detail , step by step , I have to go through complete code and lot of calculation involved in this process. But it is going fine in most of the cases except when new files are copied and all of you answered for that. Thanks alot for your respopnse. -Gopal. On 1/15/08, David Chinner wrote: > > On Mon, Jan 14, 2008 at 05:44:22PM +0530, Gopala Krishna wrote: > > Hi, > > I am seeing some strange problem with XFS and would like to know the > > expected behavior and if it is faulty is there any patches to resolve > the > > problem. > > > > Problem: > > ====== > > Basically I am extracting metadata information for a given file by > reading > > the inode structure from the particular disk offset (based on > it's position > > calculated by published inode structure and super block structure > > information). Before reading the metada data information from the disk, > I > > am calling fsync (I used to call sync, but later I changed to fsync, > since > > sync is not guranteed to flush all meta data) to ensure all metadata > > related to file is flushed to disk. Later I am reading particular disk > > offset as per calculation. I am getting XFS magic field properly after > > mapping to XFs inode structure. However I am not getting dimode properly > in > > some cases (not all cases) and it shows 00000 even for regular file and > > directory. > > How are you finding and reading the inode off disk? > > Cheers, > > Dave. > -- > Dave Chinner > Principal Engineer > SGI Australian Software Group > [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Tue Jan 15 07:17:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 07:18:23 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0FFHnQu027243 for ; Tue, 15 Jan 2008 07:17:51 -0800 X-ASG-Debug-ID: 1200410286-48f203720000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DEB1851F1A5 for ; Tue, 15 Jan 2008 07:18:06 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id GRCUC4r4kROJbVYs for ; Tue, 15 Jan 2008 07:18:06 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id BA8C618CFB088; Tue, 15 Jan 2008 09:18:03 -0600 (CST) Message-ID: <478CCEAC.9010008@sandeen.net> Date: Tue, 15 Jan 2008 09:18:04 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Gopala Krishna CC: David Chinner , Chris Wedgwood , Matthias Schniedermeyer , =?windows-1252?Q?Olaf_Fra=3Bczyk?= , Andi Kleen , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Question related to XFS sync , especially fsync Subject: Re: Question related to XFS sync , especially fsync References: <20080114224245.GT155259@sgi.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200410287 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39596 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5483/Mon Jan 14 06:45:01 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14130 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 Gopala Krishna wrote: > Hi All, > Thanks a lot for your response. > I never thought it might be in a log and not flushed to disk. > Very good clue. > >>>> It is not XFS problem. It is your problem ;) > Good comment. Agreed : -). > >>> How are you finding and inode off disk > > I have lot of code getting in to that. To explain that I have to go through > that complex part of the code to explain in detail. > > Basically once we get indoe number for a given file from the available > system call, we only depending upon the XFS layout and it's structure. We > are reading super block from a particular disk offset and calculating > address for inode offset and its address on the disk and reading directly > from the disk offset. We are totally depending on XFS on disk layout. Can I ask why you are doing this? :) -Eric From owner-xfs@oss.sgi.com Tue Jan 15 08:47:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 08:48:03 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.0 required=5.0 tests=BAYES_50,FUZZY_CREDIT, MISSING_SUBJECT autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0FGlooF006878 for ; Tue, 15 Jan 2008 08:47:54 -0800 X-ASG-Debug-ID: 1200415684-71f602290001-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from Thinpad01 (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 0C568122B53D; Tue, 15 Jan 2008 08:48:05 -0800 (PST) Received: from Thinpad01 ([68.236.66.252]) by cuda.sgi.com with SMTP id Ql62YEnS4j4fAX0k; Tue, 15 Jan 2008 08:48:05 -0800 (PST) From: "Lloyd" To: xfs-master@oss.sgi.com X-Barracuda-Connect: UNKNOWN[68.236.66.252] X-Barracuda-Start-Time: 1200415686 Message-Id: <20080115164805.0C568122B53D@cuda.sgi.com> Date: Tue, 15 Jan 2008 08:48:05 -0800 (PST) X-Barracuda-Bayes: INNOCENT GLOBAL 0.0395 1.0000 -1.7663 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 1.84 X-Barracuda-Spam-Status: No, SCORE=1.84 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=FUZZY_CREDIT, MISSING_SUBJECT, MSGID_FROM_MTA_ID X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39601 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.70 MSGID_FROM_MTA_ID Message-Id for external message added locally 1.56 FUZZY_CREDIT BODY: Attempt to obfuscate words in spam 1.34 MISSING_SUBJECT Missing Subject: header X-Virus-Scanned: ClamAV 0.91.2/5483/Mon Jan 14 06:45:01 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14133 Subject: (no subject) X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Lloyd@telus.blackberry.net Precedence: bulk X-list: xfs xfs@oss.sgi.com Subject: Have a 7OO Fico Score in a Month Date: Thu, 17 Jan 2008 16:40:48 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Unsent: 1 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Email message from: %SENDER% ; Begin the new year right and get rid of negative things on your credlt report for a l5O bucks. Takes about one month to see changes on report. www.scoreflight.net/ has various methods to get yourself a "A" or "B" fico score overnight. See for yourself. Get 5O bucks off total price with promo code elmogo . You can click reply and be taken off of this subscriber list. Thanks for your time and have a good day. From owner-xfs@oss.sgi.com Tue Jan 15 08:47:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 08:48:00 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.0 required=5.0 tests=BAYES_50,FUZZY_CREDIT, MISSING_SUBJECT autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0FGllD0006865 for ; Tue, 15 Jan 2008 08:47:50 -0800 X-ASG-Debug-ID: 1200415684-71f602290000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from Thinpad01 (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 35CE4122B536; Tue, 15 Jan 2008 08:48:04 -0800 (PST) Received: from Thinpad01 ([68.236.66.252]) by cuda.sgi.com with SMTP id 4ER81OWryUjz5qTr; Tue, 15 Jan 2008 08:48:04 -0800 (PST) From: "Kim" To: xfs-master@oss.sgi.com X-Barracuda-Connect: UNKNOWN[68.236.66.252] X-Barracuda-Start-Time: 1200415685 Message-Id: <20080115164804.35CE4122B536@cuda.sgi.com> Date: Tue, 15 Jan 2008 08:48:04 -0800 (PST) X-Barracuda-Bayes: INNOCENT GLOBAL 0.0077 1.0000 -1.9707 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 1.63 X-Barracuda-Spam-Status: No, SCORE=1.63 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=FUZZY_CREDIT, MISSING_SUBJECT, MSGID_FROM_MTA_ID X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39601 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.70 MSGID_FROM_MTA_ID Message-Id for external message added locally 1.56 FUZZY_CREDIT BODY: Attempt to obfuscate words in spam 1.34 MISSING_SUBJECT Missing Subject: header X-Virus-Scanned: ClamAV 0.91.2/5483/Mon Jan 14 06:45:01 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14132 Subject: (no subject) X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Kim@aol.com Precedence: bulk X-list: xfs xfs@oss.sgi.com Subject: Remove neg credlt for a hundred fifty Date: Thu, 17 Jan 2008 16:40:48 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Unsent: 1 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Today's news from %SENDER% - Begin the new year right and get rid of negative things on your credlt report for a l5O bucks. Takes about one month to see changes on report. www.scoreflight.net/ has various methods to get yourself a "A" or "B" fico score overnight. See for yourself. sAVE 5O bucks off total price with promo code elmogo. You can click reply and be take off of this subscriber list. Thanks and have a great day. From owner-xfs@oss.sgi.com Tue Jan 15 08:47:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 08:48:00 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.0 required=5.0 tests=BAYES_50,FUZZY_CREDIT, MISSING_SUBJECT autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0FGllhQ006863 for ; Tue, 15 Jan 2008 08:47:50 -0800 X-ASG-Debug-ID: 1200415684-71f9022c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from Thinpad01 (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id CAC1F122B535; Tue, 15 Jan 2008 08:48:04 -0800 (PST) Received: from Thinpad01 ([68.236.66.252]) by cuda.sgi.com with SMTP id hvtiCKO7em2odM5I; Tue, 15 Jan 2008 08:48:04 -0800 (PST) From: "Benjamin" To: xfs@oss.sgi.com X-Barracuda-Connect: UNKNOWN[68.236.66.252] X-Barracuda-Start-Time: 1200415684 Message-Id: <20080115164804.CAC1F122B535@cuda.sgi.com> Date: Tue, 15 Jan 2008 08:48:04 -0800 (PST) X-Barracuda-Bayes: INNOCENT GLOBAL 0.0241 1.0000 -1.8647 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 1.74 X-Barracuda-Spam-Status: No, SCORE=1.74 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=FUZZY_CREDIT, MISSING_SUBJECT, MSGID_FROM_MTA_ID X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39601 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.70 MSGID_FROM_MTA_ID Message-Id for external message added locally 1.56 FUZZY_CREDIT BODY: Attempt to obfuscate words in spam 1.34 MISSING_SUBJECT Missing Subject: header X-Virus-Scanned: ClamAV 0.91.2/5483/Mon Jan 14 06:45:01 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14131 Subject: (no subject) X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Benjamin@telus.blackberry.net Precedence: bulk X-list: xfs xfs-master@oss.sgi.com Subject: Remove neg credlt for a hundred fifty Date: Thu, 17 Jan 2008 16:40:48 -0500 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Unsent: 1 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Today's news from %SENDER% - Begin the new year right and get rid of negative things on your credlt report for a l5O bucks. Takes about one month to see changes on report. www.scoreflight.net/ has various methods to get yourself a "A" or "B" fico score overnight. See for yourself. sAVE 5O bucks off total price with promo code elmogo. You can click reply and be take off of this subscriber list. Thanks and have a great day. From owner-xfs@oss.sgi.com Tue Jan 15 09:29:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 09:29:07 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0FHSxNw010216 for ; Tue, 15 Jan 2008 09:29:01 -0800 X-ASG-Debug-ID: 1200418154-7b9100c80000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C7927520791 for ; Tue, 15 Jan 2008 09:29:14 -0800 (PST) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id NPJBXl0UCYvsDvHW for ; Tue, 15 Jan 2008 09:29:14 -0800 (PST) Received: by lucidpixels.com (Postfix, from userid 1001) id 1572C1C001994; Tue, 15 Jan 2008 12:29:14 -0500 (EST) Date: Tue, 15 Jan 2008 12:29:14 -0500 (EST) From: Justin Piszcz X-X-Sender: jpiszcz@p34.internal.lan To: xfs@oss.sgi.com X-ASG-Orig-Subj: Proper swidth and sunit for RAID 5 (does it matter)? Subject: Proper swidth and sunit for RAID 5 (does it matter)? Message-ID: User-Agent: Alpine 0.999999 (DEB 847 2007-12-06) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1200418157 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39603 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5483/Mon Jan 14 06:45:01 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14134 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs Dave, What is the proper sunit and swidth for a 64, 256, and 1024 kilobyte chunk size with a 10-disk raid 5? Also, in the majority of benchmarks it does not seem to matter whether the FS is stripe-aligned or not (with SW raid)- does it mainly/only affect HW raid? Current settings (10 disks): # xfs_info /dev/md3 meta-data=/dev/md3 isize=256 agcount=4, agsize=82417536 blks = sectsz=4096 attr=2 data = bsize=4096 blocks=329670144, imaxpct=25 = sunit=0 swidth=0 blks, unwritten=1 naming =version 2 bsize=4096 log =internal bsize=4096 blocks=32768, version=2 = sectsz=4096 sunit=1 blks, lazy-count=1 realtime =none extsz=9437184 blocks=0, rtextents=0 Justin. From owner-xfs@oss.sgi.com Tue Jan 15 13:34:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 13:34:13 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0FLY1x1002663 for ; Tue, 15 Jan 2008 13:34:05 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id IAA12568; Wed, 16 Jan 2008 08:34:14 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0FLYDLF26386408; Wed, 16 Jan 2008 08:34:14 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0FLYBAn26433418; Wed, 16 Jan 2008 08:34:11 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Wed, 16 Jan 2008 08:34:10 +1100 From: David Chinner To: Justin Piszcz Cc: xfs@oss.sgi.com Subject: Re: Proper swidth and sunit for RAID 5 (does it matter)? Message-ID: <20080115213410.GM155407@sgi.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5484/Tue Jan 15 11:31:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14135 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Tue, Jan 15, 2008 at 12:29:14PM -0500, Justin Piszcz wrote: > Dave, > > What is the proper sunit and swidth for a 64, 256, and 1024 kilobyte chunk > size with a 10-disk raid 5? > > Also, in the majority of benchmarks it does not seem to matter whether the > FS is stripe-aligned or not (with SW raid)- does it mainly/only affect HW > raid? Affects both. If you are doing large I/O, both SW and HW raid will avoid RMW cycles if you can do full stripe writes and that means they go faster. The faster the RAID array, the bigger the difference it will make. If your tests are with small I/O or with a config that can't do I/O large enough for full stripe writes, then you won't see any difference as you're not avoiding RMW cycles. > Current settings (10 disks): > > # xfs_info /dev/md3 > meta-data=/dev/md3 isize=256 agcount=4, agsize=82417536 Why 4 ags? The low number of AGs is an optimisation for single disks, not multi-disk arrays that have much more parallelism and seek capacity available. > blks > = sectsz=4096 attr=2 > data = bsize=4096 blocks=329670144, imaxpct=25 > = sunit=0 swidth=0 blks, unwritten=1 And you don't even have su/sw set here, so XFS won't be doing any alignment optimisation at all. Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Tue Jan 15 14:24:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 14:24:24 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0FMOI78010797 for ; Tue, 15 Jan 2008 14:24:20 -0800 X-ASG-Debug-ID: 1200435872-1ac401450000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from postoffice.aconex.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BFBFA522B04 for ; Tue, 15 Jan 2008 14:24:32 -0800 (PST) Received: from postoffice.aconex.com (prod.aconex.com [203.89.192.138]) by cuda.sgi.com with ESMTP id pp0bD6ULC8UZuxxt for ; Tue, 15 Jan 2008 14:24:32 -0800 (PST) Received: from edge.scott.net.au (unknown [203.89.192.141]) by postoffice.aconex.com (Postfix) with ESMTP id 5ADCA92D65B; Wed, 16 Jan 2008 09:23:59 +1100 (EST) X-ASG-Orig-Subj: Re: Question related to XFS sync , especially fsync Subject: Re: Question related to XFS sync , especially fsync From: Nathan Scott Reply-To: nscott@aconex.com To: Gopala Krishna Cc: Eric Sandeen , David Chinner , Chris Wedgwood , Matthias Schniedermeyer , "Olaf Fra;czyk" , Andi Kleen , xfs@oss.sgi.com In-Reply-To: <478CCEAC.9010008@sandeen.net> References: <20080114224245.GT155259@sgi.com> <478CCEAC.9010008@sandeen.net> Content-Type: text/plain Organization: Aconex Date: Wed, 16 Jan 2008 09:26:52 +1100 Message-Id: <1200436012.9463.184.camel@edge.scott.net.au> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: prod.aconex.com[203.89.192.138] X-Barracuda-Start-Time: 1200435876 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39623 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5484/Tue Jan 15 11:31:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14136 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: nscott@aconex.com Precedence: bulk X-list: xfs On Tue, 2008-01-15 at 09:18 -0600, Eric Sandeen wrote: > > > I have lot of code getting in to that. To explain that I have to go > through > > that complex part of the code to explain in detail. > > > > Basically once we get indoe number for a given file from the > available > > system call, we only depending upon the XFS layout and it's > structure. We > > are reading super block from a particular disk offset and > calculating > > address for inode offset and its address on the disk and reading > directly > > from the disk offset. We are totally depending on XFS on disk > layout. > > Can I ask why you are doing this? :) > This would be good to know. If you absolutely must use inode numbers instead of path names, you should use the "by-handle" interface (like xfsdump, xfs_fsr, etc) and not use the ondisk structures directly - doing so is always "broken by design" and you'll get little sympathy here for doing so. :) cheers. -- Nathan From owner-xfs@oss.sgi.com Tue Jan 15 16:50:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 16:51:09 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0G0orwD023453 for ; Tue, 15 Jan 2008 16:50:57 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA19900; Wed, 16 Jan 2008 11:51:05 +1100 Date: Wed, 16 Jan 2008 11:51:21 +1100 To: "Chandan Talukdar" Subject: Re: [REVIEW] Refactor xfs_repair's process_dinode_int From: "Barry Naujok" Organization: SGI Cc: "xfs@oss.sgi.com" Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <4782B72D.8070208@agami.com> <47833C0F.6070206@agami.com> <478D1899.9080201@agami.com> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <478D1899.9080201@agami.com> User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5484/Tue Jan 15 11:31:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14137 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Wed, 16 Jan 2008 07:33:29 +1100, Chandan Talukdar wrote: > Hi Barry, > > - In process_misc_ino_types(), dino->di_core.di_size is being accessed > without being converted to machine format. The check is being performed > against 0; so, it should be fine. But for better code readability, I > guess it should be accessed through be64_to_cpu(). Yeah... sort of in two-minds about this one. > - In change_dinode_fmt(), it might be worthwhile to add an ASSERT > against someone passing a value greater than 16 bit for 'new_fmt'. Good idea. > - In process_inode_attr_fork(), di_anextents should be accessed using > be16_to_cpu as it is a 16 bit quantity. > > - In process_dinode_int() line 2691, dinoc->di_extsize should be > accessed using be32_to_cpu(). Good pickup on these, thanks :) > - In process_dinode_int(), we should be checking for 'dblkmap' not being > NULL before freeing it. There are a few error conditions which can > cause the control to go to 'clear_bad_out' with dblkmap being NULL. freeing a NULL is valid, from the man page: free() frees the memory space pointed to by ptr, which must have been returned by a previous call to malloc(), calloc() or realloc(). Otherwise, or if free(ptr) has already been called before, undefined behaviour occurs. >>> If ptr is NULL, no operation is performed. <<< > Thanks, > Chandan From owner-xfs@oss.sgi.com Tue Jan 15 17:03:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 17:03:18 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63, J_CHICKENPOX_66 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0G13CL6024399 for ; Tue, 15 Jan 2008 17:03:12 -0800 X-ASG-Debug-ID: 1200445402-43c700490000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ext.agami.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3E7765238F4 for ; Tue, 15 Jan 2008 17:03:22 -0800 (PST) Received: from ext.agami.com (64.221.212.177.ptr.us.xo.net [64.221.212.177]) by cuda.sgi.com with ESMTP id ueIrCCXiCRH52zRc for ; Tue, 15 Jan 2008 17:03:22 -0800 (PST) Received: from agami.com (mail [192.168.168.5]) by ext.agami.com (8.12.5/8.12.5) with ESMTP id m0G12uWb020888 for ; Tue, 15 Jan 2008 17:02:56 -0800 Received: from mx1.agami.com (mx1.agami.com [10.123.10.30]) by agami.com (8.12.11/8.12.11) with ESMTP id m0G12p2J001913 for ; Tue, 15 Jan 2008 17:02:51 -0800 Received: from [10.123.4.142] ([10.123.4.142]) by mx1.agami.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 15 Jan 2008 17:03:13 -0800 Message-ID: <478D57D1.2000600@agami.com> Date: Tue, 15 Jan 2008 17:03:13 -0800 From: Michael Nishimoto User-Agent: Mail/News 1.5.0.4 (X11/20060629) MIME-Version: 1.0 To: Barry Naujok CC: xfs@oss.sgi.com, xfs-dev , Chandan Talukdar X-ASG-Orig-Subj: Re: [REVIEW] Refactor xfs_repair's process_dinode_int Subject: Re: [REVIEW] Refactor xfs_repair's process_dinode_int References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 16 Jan 2008 01:03:13.0922 (UTC) FILETIME=[92038E20:01C857DB] X-Scanned-By: MIMEDefang 2.58 on 192.168.168.13 X-Barracuda-Connect: 64.221.212.177.ptr.us.xo.net[64.221.212.177] X-Barracuda-Start-Time: 1200445407 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39634 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5484/Tue Jan 15 11:31:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14138 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: miken@agami.com Precedence: bulk X-list: xfs Hi, I'm posting this for Chandan Talukdar because his email address has been booted from the xfs mailing list again. Michael =============================================== - In process_misc_ino_types(), dino->di_core.di_size is being accessed without being converted to machine format. The check is being performed against 0; so, it should be fine. But for better code readability, I guess it should be accessed through be64_to_cpu(). - In change_dinode_fmt(), it might be worthwhile to add an ASSERT against someone passing a value greater than 16 bit for 'new_fmt'. - In process_inode_attr_fork(), di_anextents should be accessed using be16_to_cpu as it is a 16 bit quantity. - In process_dinode_int() line 2691, dinoc->di_extsize should be accessed using be32_to_cpu(). - In process_dinode_int(), we should be checking for 'dblkmap' not being NULL before freeing it. There are a few error conditions which can cause the control to go to 'clear_bad_out' with dblkmap being NULL. Thanks, Chandan Barry Naujok wrote: > Implementing casefold-table checking in xfs_repair, I have to > touch process_dinode_int. It's a horrendous function. The attached > patch hopefully makes it much clearer what it does and removes a > lot of duplicate code when bad inodes are found. There are some > obscure bug fixes too (eg. two places where the inode's di_mode is > updated, but not marked dirty - libxfs would have tossed it). > > The refactoring involved removing unused variables, working out > what various variables actually did and use them appropriately > and break blocks of functionality into separate functions. > > Barry. > > > ------------------------------------------------------------------------ > > > =========================================================================== > xfsprogs/repair/dino_chunks.c > =========================================================================== > > --- a/xfsprogs/repair/dino_chunks.c 2007-11-15 17:24:33.000000000 +1100 > +++ b/xfsprogs/repair/dino_chunks.c 2007-11-14 15:41:03.188152397 +1100 > @@ -593,7 +593,6 @@ process_inode_chunk( > xfs_agino_t agino; > xfs_agblock_t agbno; > int dirty = 0; > - int cleared = 0; > int isa_dir = 0; > int blks_per_cluster; > int cluster_count; > @@ -777,8 +776,7 @@ process_inode_chunk( > > status = process_dinode(mp, dino, agno, agino, > is_inode_free(ino_rec, irec_offset), > - &ino_dirty, &cleared, &is_used, > - ino_discovery, check_dups, > + &ino_dirty, &is_used,ino_discovery, check_dups, > extra_attr_check, &isa_dir, &parent); > > ASSERT(is_used != 3); > > =========================================================================== > xfsprogs/repair/dinode.c > =========================================================================== > > --- a/xfsprogs/repair/dinode.c 2007-11-15 17:24:33.000000000 +1100 > +++ b/xfsprogs/repair/dinode.c 2007-11-15 17:23:49.322691248 +1100 > @@ -58,9 +58,6 @@ calc_attr_offset(xfs_mount_t *mp, xfs_di > case XFS_DINODE_FMT_LOCAL: > offset += INT_GET(dinoc->di_size, ARCH_CONVERT); > break; > - case XFS_DINODE_FMT_UUID: > - offset += sizeof(uuid_t); > - break; > case XFS_DINODE_FMT_EXTENTS: > offset += INT_GET(dinoc->di_nextents, ARCH_CONVERT) * sizeof(xfs_bmbt_rec_32_t); > break; > @@ -1563,8 +1560,11 @@ null_check(char *name, int length) > * bogus > */ > int > -process_symlink(xfs_mount_t *mp, xfs_ino_t lino, xfs_dinode_t *dino, > - blkmap_t *blkmap) > +process_symlink( > + xfs_mount_t *mp, > + xfs_ino_t lino, > + xfs_dinode_t *dino, > + blkmap_t *blkmap) > { > xfs_dfsbno_t fsbno; > xfs_dinode_core_t *dinoc = &dino->di_core; > @@ -1673,8 +1673,7 @@ process_symlink(xfs_mount_t *mp, xfs_ino > * called to process the set of misc inode special inode types > * that have no associated data storage (fifos, pipes, devices, etc.). > */ > -/* ARGSUSED */ > -int > +static int > process_misc_ino_types(xfs_mount_t *mp, > xfs_dinode_t *dino, > xfs_ino_t lino, > @@ -1693,27 +1692,27 @@ process_misc_ino_types(xfs_mount_t *mp, > /* > * must also have a zero size > */ > - if (INT_GET(dino->di_core.di_size, ARCH_CONVERT) != 0) { > + if (dino->di_core.di_size != 0) { > switch (type) { > case XR_INO_CHRDEV: > do_warn(_("size of character device inode %llu != 0 " > "(%lld bytes)\n"), lino, > - INT_GET(dino->di_core.di_size, ARCH_CONVERT)); > + be64_to_cpu(dino->di_core.di_size)); > break; > case XR_INO_BLKDEV: > do_warn(_("size of block device inode %llu != 0 " > "(%lld bytes)\n"), lino, > - INT_GET(dino->di_core.di_size, ARCH_CONVERT)); > + be64_to_cpu(dino->di_core.di_size)); > break; > case XR_INO_SOCK: > do_warn(_("size of socket inode %llu != 0 " > "(%lld bytes)\n"), lino, > - INT_GET(dino->di_core.di_size, ARCH_CONVERT)); > + be64_to_cpu(dino->di_core.di_size)); > break; > case XR_INO_FIFO: > do_warn(_("size of fifo inode %llu != 0 " > "(%lld bytes)\n"), lino, > - INT_GET(dino->di_core.di_size, ARCH_CONVERT)); > + be64_to_cpu(dino->di_core.di_size)); > break; > default: > do_warn(_("Internal error - process_misc_ino_types, " > @@ -1769,712 +1768,393 @@ process_misc_ino_types_blocks(xfs_drfsbn > return (0); > } > > -/* > - * returns 0 if the inode is ok, 1 if the inode is corrupt > - * check_dups can be set to 1 *only* when called by the > - * first pass of the duplicate block checking of phase 4. > - * *dirty is set > 0 if the dinode has been altered and > - * needs to be written out. > - * > - * for detailed, info, look at process_dinode() comments. > - */ > -/* ARGSUSED */ > -int > -process_dinode_int(xfs_mount_t *mp, > - xfs_dinode_t *dino, > - xfs_agnumber_t agno, > - xfs_agino_t ino, > - int was_free, /* 1 if inode is currently free */ > - int *dirty, /* out == > 0 if inode is now dirty */ > - int *cleared, /* out == 1 if inode was cleared */ > - int *used, /* out == 1 if inode is in use */ > - int verify_mode, /* 1 == verify but don't modify inode */ > - int uncertain, /* 1 == inode is uncertain */ > - int ino_discovery, /* 1 == check dirs for unknown inodes */ > - int check_dups, /* 1 == check if inode claims > - * duplicate blocks */ > - int extra_attr_check, /* 1 == do attribute format and value checks */ > - int *isa_dir, /* out == 1 if inode is a directory */ > - xfs_ino_t *parent) /* out -- parent if ino is a dir */ > +static inline int > +dinode_fmt( > + xfs_dinode_core_t *dinoc) > { > - xfs_drfsbno_t totblocks = 0; > - xfs_drfsbno_t atotblocks = 0; > - xfs_dinode_core_t *dinoc; > - char *rstring; > - int type; > - int rtype; > - int do_rt; > - int err; > - int retval = 0; > - __uint64_t nextents; > - __uint64_t anextents; > - xfs_ino_t lino; > - const int is_free = 0; > - const int is_used = 1; > - int repair = 0; > - blkmap_t *ablkmap = NULL; > - blkmap_t *dblkmap = NULL; > - static char okfmts[] = { > - 0, /* free inode */ > - 1 << XFS_DINODE_FMT_DEV, /* FIFO */ > - 1 << XFS_DINODE_FMT_DEV, /* CHR */ > - 0, /* type 3 unused */ > - (1 << XFS_DINODE_FMT_LOCAL) | > - (1 << XFS_DINODE_FMT_EXTENTS) | > - (1 << XFS_DINODE_FMT_BTREE), /* DIR */ > - 0, /* type 5 unused */ > - 1 << XFS_DINODE_FMT_DEV, /* BLK */ > - 0, /* type 7 unused */ > - (1 << XFS_DINODE_FMT_EXTENTS) | > - (1 << XFS_DINODE_FMT_BTREE), /* REG */ > - 0, /* type 9 unused */ > - (1 << XFS_DINODE_FMT_LOCAL) | > - (1 << XFS_DINODE_FMT_EXTENTS), /* LNK */ > - 0, /* type 11 unused */ > - 1 << XFS_DINODE_FMT_DEV, /* SOCK */ > - 0, /* type 13 unused */ > - 1 << XFS_DINODE_FMT_UUID, /* MNT */ > - 0 /* type 15 unused */ > - }; > - > - retval = 0; > - totblocks = atotblocks = 0; > - *dirty = *isa_dir = *cleared = 0; > - *used = is_used; > - type = rtype = XR_INO_UNKNOWN; > - rstring = NULL; > - do_rt = 0; > + return be16_to_cpu(dinoc->di_mode) & S_IFMT; > +} > > - dinoc = &dino->di_core; > - lino = XFS_AGINO_TO_INO(mp, agno, ino); > +static inline void > +change_dinode_fmt( > + xfs_dinode_core_t *dinoc, > + int new_fmt) > +{ > + int mode = be16_to_cpu(dinoc->di_mode); > > - /* > - * if in verify mode, don't modify the inode. > - * > - * if correcting, reset stuff that has known values > - * > - * if in uncertain mode, be silent on errors since we're > - * trying to find out if these are inodes as opposed > - * to assuming that they are. Just return the appropriate > - * return code in that case. > - */ > + mode &= ~S_IFMT; > + mode |= new_fmt; > + dinoc->di_mode = cpu_to_be16(mode); > +} > > - if (INT_GET(dinoc->di_magic, ARCH_CONVERT) != XFS_DINODE_MAGIC) { > - retval++; > - if (!verify_mode) { > - do_warn(_("bad magic number 0x%x on inode %llu, "), > - INT_GET(dinoc->di_magic, ARCH_CONVERT), lino); > +static int > +check_dinode_mode_format( > + xfs_dinode_core_t *dinoc) > +{ > + if ((uchar_t)dinoc->di_format >= XFS_DINODE_FMT_UUID) > + return -1; /* FMT_UUID is not used */ > + > + switch (dinode_fmt(dinoc)) { > + case S_IFIFO: > + case S_IFCHR: > + case S_IFBLK: > + case S_IFSOCK: > + return (dinoc->di_format != XFS_DINODE_FMT_DEV) ? -1 : 0; > + > + case S_IFDIR: > + return (dinoc->di_format < XFS_DINODE_FMT_LOCAL || > + dinoc->di_format > XFS_DINODE_FMT_BTREE) ? -1 : 0; > + > + case S_IFREG: > + return (dinoc->di_format < XFS_DINODE_FMT_EXTENTS || > + dinoc->di_format > XFS_DINODE_FMT_BTREE) ? -1 : 0; > + > + case S_IFLNK: > + return (dinoc->di_format < XFS_DINODE_FMT_LOCAL || > + dinoc->di_format > XFS_DINODE_FMT_EXTENTS) ? -1 : 0; > + > + default: ; > + } > + return 0; /* invalid modes are checked elsewhere */ > +} > + > +/* > + * If inode is a superblock inode, does type check to make sure is it valid. > + * Returns 0 if it's valid, non-zero if it needs to be cleared. > + */ > + > +static int > +process_check_sb_inodes( > + xfs_mount_t *mp, > + xfs_dinode_core_t *dinoc, > + xfs_ino_t lino, > + int *type, > + int *dirty) > +{ > + if (lino == mp->m_sb.sb_rootino) { > + if (*type != XR_INO_DIR) { > + do_warn(_("root inode %llu has bad type 0x%x\n"), > + lino, dinode_fmt(dinoc)); > + *type = XR_INO_DIR; > if (!no_modify) { > - do_warn(_("resetting magic number\n")); > + do_warn(_("resetting to directory\n")); > + change_dinode_fmt(dinoc, S_IFDIR); > *dirty = 1; > - INT_SET(dinoc->di_magic, ARCH_CONVERT, > - XFS_DINODE_MAGIC); > - } else { > - do_warn(_("would reset magic number\n")); > - } > - } else if (!uncertain) { > - do_warn(_("bad magic number 0x%x on inode %llu\n"), > - INT_GET(dinoc->di_magic, ARCH_CONVERT), lino); > + } else > + do_warn(_("would reset to directory\n")); > } > + return 0; > } > - > - if (!XFS_DINODE_GOOD_VERSION(dinoc->di_version) || > - (!fs_inode_nlink && dinoc->di_version > XFS_DINODE_VERSION_1)) { > - retval++; > - if (!verify_mode) { > - do_warn(_("bad version number 0x%x on inode %llu, "), > - dinoc->di_version, lino); > + if (lino == mp->m_sb.sb_uquotino) { > + if (*type != XR_INO_DATA) { > + do_warn(_("user quota inode %llu has bad type 0x%x\n"), > + lino, dinode_fmt(dinoc)); > + mp->m_sb.sb_uquotino = NULLFSINO; > + return 1; > + } > + return 0; > + } > + if (lino == mp->m_sb.sb_gquotino) { > + if (*type != XR_INO_DATA) { > + do_warn(_("group quota inode %llu has bad type 0x%x\n"), > + lino, dinode_fmt(dinoc)); > + mp->m_sb.sb_gquotino = NULLFSINO; > + return 1; > + } > + return 0; > + } > + if (lino == mp->m_sb.sb_rsumino) { > + if (*type != XR_INO_RTSUM) { > + do_warn(_("realtime summary inode %llu has bad type 0x%x, "), > + lino, dinode_fmt(dinoc)); > if (!no_modify) { > - do_warn(_("resetting version number\n")); > + do_warn(_("resetting to regular file\n")); > + change_dinode_fmt(dinoc, S_IFREG); > *dirty = 1; > - dinoc->di_version = (fs_inode_nlink) ? > - XFS_DINODE_VERSION_2 : > - XFS_DINODE_VERSION_1; > } else { > - do_warn(_("would reset version number\n")); > + do_warn(_("would reset to regular file\n")); > } > - } else if (!uncertain) { > - do_warn(_("bad version number 0x%x on inode %llu\n"), > - dinoc->di_version, lino); > } > + if (mp->m_sb.sb_rblocks == 0 && dinoc->di_nextents != 0) { > + do_warn(_("bad # of extents (%u) for realtime summary inode %llu\n"), > + be32_to_cpu(dinoc->di_nextents), lino); > + return 1; > + } > + return 0; > } > - > - /* > - * blow out of here if the inode size is < 0 > - */ > - if (INT_GET(dinoc->di_size, ARCH_CONVERT) < 0) { > - retval++; > - if (!verify_mode) { > - do_warn(_("bad (negative) size %lld on inode %llu\n"), > - INT_GET(dinoc->di_size, ARCH_CONVERT), lino); > + if (lino == mp->m_sb.sb_rbmino) { > + if (*type != XR_INO_RTBITMAP) { > + do_warn(_("realtime bitmap inode %llu has bad type 0x%x, "), > + lino, dinode_fmt(dinoc)); > if (!no_modify) { > - *dirty += clear_dinode(mp, dino, lino); > - *cleared = 1; > - } else { > + do_warn(_("resetting to regular file\n")); > + change_dinode_fmt(dinoc, S_IFREG); > *dirty = 1; > - *cleared = 1; > + } else { > + do_warn(_("would reset to regular file\n")); > } > - *used = is_free; > - } else if (!uncertain) { > - do_warn(_("bad (negative) size %lld on inode %llu\n"), > - INT_GET(dinoc->di_size, ARCH_CONVERT), lino); > } > - > - return(1); > + if (mp->m_sb.sb_rblocks == 0 && dinoc->di_nextents != 0) { > + do_warn(_("bad # of extents (%u) for realtime bitmap inode %llu\n"), > + be32_to_cpu(dinoc->di_nextents), lino); > + return 1; > + } > + return 0; > } > + return 0; > +} > > - /* > - * was_free value is not meaningful if we're in verify mode > - */ > - if (!verify_mode && INT_GET(dinoc->di_mode, ARCH_CONVERT) == 0 && was_free == 1) { > - /* > - * easy case, inode free -- inode and map agree, clear > - * it just in case to ensure that format, etc. are > - * set correctly > - */ > - if (!no_modify) { > - err = clear_dinode(mp, dino, lino); > - if (err) { > - *dirty = 1; > - *cleared = 1; > - } > +/* > + * general size/consistency checks: > + * > + * if the size <= size of the data fork, directories must be > + * local inodes unlike regular files which would be extent inodes. > + * all the other mentioned types have to have a zero size value. > + * > + * if the size and format don't match, get out now rather than > + * risk trying to process a non-existent extents or btree > + * type data fork. > + */ > +static int > +process_check_inode_sizes( > + xfs_mount_t *mp, > + xfs_dinode_t *dino, > + xfs_ino_t lino, > + int type) > +{ > + xfs_dinode_core_t *dinoc = &dino->di_core; > + xfs_fsize_t size = be64_to_cpu(dinoc->di_size); > + > + switch (type) { > + > + case XR_INO_DIR: > + if (size <= XFS_DFORK_DSIZE(dino, mp) && > + dinoc->di_format != XFS_DINODE_FMT_LOCAL) { > + do_warn(_("mismatch between format (%d) and size " > + "(%lld) in directory ino %llu\n"), > + dinoc->di_format, size, lino); > + return 1; > } > - *used = is_free; > - return(0); > - } else if (!verify_mode && INT_GET(dinoc->di_mode, ARCH_CONVERT) == 0 && was_free == 0) { > + break; > + > + case XR_INO_SYMLINK: > + if (process_symlink_extlist(mp, lino, dino)) { > + do_warn(_("bad data fork in symlink %llu\n"), lino); > + return 1; > + } > + break; > + > + case XR_INO_CHRDEV: /* fall through to FIFO case ... */ > + case XR_INO_BLKDEV: /* fall through to FIFO case ... */ > + case XR_INO_SOCK: /* fall through to FIFO case ... */ > + case XR_INO_MOUNTPOINT: /* fall through to FIFO case ... */ > + case XR_INO_FIFO: > + if (process_misc_ino_types(mp, dino, lino, type)) > + return 1; > + break; > + > + case XR_INO_RTDATA: > /* > - * the inode looks free but the map says it's in use. > - * clear the inode just to be safe and mark the inode > - * free. > + * if we have no realtime blocks, any inode claiming > + * to be a real-time file is bogus > */ > - do_warn(_("imap claims a free inode %llu is in use, "), lino); > - > - if (!no_modify) { > - do_warn(_("correcting imap and clearing inode\n")); > + if (mp->m_sb.sb_rblocks == 0) { > + do_warn(_("found inode %llu claiming to be a " > + "real-time file\n"), lino); > + return 1; > + } > + break; > > - err = clear_dinode(mp, dino, lino); > - if (err) { > - retval++; > - *dirty = 1; > - *cleared = 1; > - } > - } else { > - do_warn(_("would correct imap and clear inode\n")); > + case XR_INO_RTBITMAP: > + if (size != (__int64_t)mp->m_sb.sb_rbmblocks * > + mp->m_sb.sb_blocksize) { > + do_warn(_("realtime bitmap inode %llu has bad size " > + "%lld (should be %lld)\n"), > + lino, size, (__int64_t) mp->m_sb.sb_rbmblocks * > + mp->m_sb.sb_blocksize); > + return 1; > + } > + break; > > - *dirty = 1; > - *cleared = 1; > + case XR_INO_RTSUM: > + if (size != mp->m_rsumsize) { > + do_warn(_("realtime summary inode %llu has bad size " > + "%lld (should be %d)\n"), > + lino, size, mp->m_rsumsize); > + return 1; > } > + break; > > - *used = is_free; > + default: > + break; > + } > + return 0; > +} > > - return(retval > 0 ? 1 : 0); > +/* > + * check for illegal values of forkoff > + */ > +static int > +process_check_inode_forkoff( > + xfs_mount_t *mp, > + xfs_dinode_core_t *dinoc, > + xfs_ino_t lino) > +{ > + if (dinoc->di_forkoff == 0) > + return 0; > + > + switch (dinoc->di_format) { > + case XFS_DINODE_FMT_DEV: > + if (dinoc->di_forkoff != (roundup(sizeof(xfs_dev_t), 8) >> 3)) { > + do_warn(_("bad attr fork offset %d in dev inode %llu, " > + "should be %d\n"), dinoc->di_forkoff, lino, > + (int)(roundup(sizeof(xfs_dev_t), 8) >> 3)); > + return 1; > + } > + break; > + case XFS_DINODE_FMT_LOCAL: /* fall through ... */ > + case XFS_DINODE_FMT_EXTENTS: /* fall through ... */ > + case XFS_DINODE_FMT_BTREE: > + if (dinoc->di_forkoff >= (XFS_LITINO(mp) >> 3)) { > + do_warn(_("bad attr fork offset %d in inode %llu, " > + "max=%d\n"), dinoc->di_forkoff, lino, > + XFS_LITINO(mp) >> 3); > + return 1; > + } > + break; > + default: > + do_error(_("unexpected inode format %d\n"), dinoc->di_format); > + break; > } > + return 0; > +} > > - /* > - * because of the lack of any write ordering guarantee, it's > - * possible that the core got updated but the forks didn't. > - * so rather than be ambitious (and probably incorrect), > - * if there's an inconsistency, we get conservative and > - * just pitch the file. blow off checking formats of > - * free inodes since technically any format is legal > - * as we reset the inode when we re-use it. > - */ > - if (INT_GET(dinoc->di_mode, ARCH_CONVERT) != 0 && > - ((((INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT) >> 12) > 15) || > - (uchar_t) dinoc->di_format > XFS_DINODE_FMT_UUID || > - (!(okfmts[(INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT) >> 12] & > - (1 << dinoc->di_format))))) { > - /* bad inode format */ > - retval++; > - if (!uncertain) > - do_warn(_("bad inode format in inode %llu\n"), lino); > - if (!verify_mode) { > - if (!no_modify) { > - *dirty += clear_dinode(mp, dino, lino); > - ASSERT(*dirty > 0); > - } > +/* > + * Updates the inodes block and extent counts if they are wrong > + */ > +static int > +process_inode_blocks_and_extents( > + xfs_dinode_core_t *dinoc, > + xfs_drfsbno_t nblocks, > + __uint64_t nextents, > + __uint64_t anextents, > + xfs_ino_t lino, > + int *dirty) > +{ > + if (nblocks != be64_to_cpu(dinoc->di_nblocks)) { > + if (!no_modify) { > + do_warn(_("correcting nblocks for inode %llu, " > + "was %llu - counted %llu\n"), lino, > + be64_to_cpu(dinoc->di_nblocks), nblocks); > + dinoc->di_nblocks = cpu_to_be64(nblocks); > + *dirty = 1; > + } else { > + do_warn(_("bad nblocks %llu for inode %llu, " > + "would reset to %llu\n"), > + be64_to_cpu(dinoc->di_nblocks), lino, nblocks); > } > - *cleared = 1; > - *used = is_free; > + } > > - return(retval > 0 ? 1 : 0); > + if (nextents > MAXEXTNUM) { > + do_warn(_("too many data fork extents (%llu) in inode %llu\n"), > + nextents, lino); > + return 1; > + } > + if (nextents != be32_to_cpu(dinoc->di_nextents)) { > + if (!no_modify) { > + do_warn(_("correcting nextents for inode %llu, " > + "was %d - counted %llu\n"), lino, > + be32_to_cpu(dinoc->di_nextents), nextents); > + dinoc->di_nextents = cpu_to_be32(nextents); > + *dirty = 1; > + } else { > + do_warn(_("bad nextents %d for inode %llu, would reset " > + "to %llu\n"), be32_to_cpu(dinoc->di_nextents), > + lino, nextents); > + } > } > > - if (verify_mode) > - return(retval > 0 ? 1 : 0); > + if (anextents > MAXAEXTNUM) { > + do_warn(_("too many attr fork extents (%llu) in inode %llu\n"), > + anextents, lino); > + return 1; > + } > + if (anextents != be16_to_cpu(dinoc->di_anextents)) { > + if (!no_modify) { > + do_warn(_("correcting anextents for inode %llu, " > + "was %d - counted %llu\n"), lino, > + be16_to_cpu(dinoc->di_anextents), anextents); > + dinoc->di_anextents = cpu_to_be16(anextents); > + *dirty = 1; > + } else { > + do_warn(_("bad anextents %d for inode %llu, would reset" > + " to %llu\n"), be16_to_cpu(dinoc->di_anextents), > + lino, anextents); > + } > + } > + return 0; > +} > > - /* > - * clear the next unlinked field if necessary on a good > - * inode only during phase 4 -- when checking for inodes > - * referencing duplicate blocks. then it's safe because > - * we've done the inode discovery and have found all the inodes > - * we're going to find. check_dups is set to 1 only during > - * phase 4. Ugly. > - */ > - if (check_dups && !no_modify) > - *dirty += clear_dinode_unlinked(mp, dino); > +/* > + * check data fork -- if it's bad, clear the inode > + */ > +static int > +process_inode_data_fork( > + xfs_mount_t *mp, > + xfs_agnumber_t agno, > + xfs_agino_t ino, > + xfs_dinode_t *dino, > + int type, > + int *dirty, > + xfs_drfsbno_t *totblocks, > + __uint64_t *nextents, > + blkmap_t **dblkmap, > + int check_dups) > +{ > + xfs_dinode_core_t *dinoc = &dino->di_core; > + xfs_ino_t lino = XFS_AGINO_TO_INO(mp, agno, ino); > + int err = 0; > > - /* set type and map type info */ > + *nextents = be32_to_cpu(dinoc->di_nextents); > + if (*nextents > be64_to_cpu(dinoc->di_nblocks) || > + *nextents > XFS_MAX_INCORE_EXTENTS) > + *nextents = 1; > + > + if (dinoc->di_format != XFS_DINODE_FMT_LOCAL && type != XR_INO_RTDATA) > + *dblkmap = blkmap_alloc(*nextents); > + *nextents = 0; > > - switch (INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT) { > - case S_IFDIR: > - type = XR_INO_DIR; > - *isa_dir = 1; > - break; > - case S_IFREG: > - if (INT_GET(dinoc->di_flags, ARCH_CONVERT) & XFS_DIFLAG_REALTIME) > - type = XR_INO_RTDATA; > - else if (lino == mp->m_sb.sb_rbmino) > - type = XR_INO_RTBITMAP; > - else if (lino == mp->m_sb.sb_rsumino) > - type = XR_INO_RTSUM; > - else > - type = XR_INO_DATA; > - break; > - case S_IFLNK: > - type = XR_INO_SYMLINK; > - break; > - case S_IFCHR: > - type = XR_INO_CHRDEV; > - break; > - case S_IFBLK: > - type = XR_INO_BLKDEV; > - break; > - case S_IFSOCK: > - type = XR_INO_SOCK; > - break; > - case S_IFIFO: > - type = XR_INO_FIFO; > - break; > - default: > - retval++; > - if (!verify_mode) { > - do_warn(_("bad inode type %#o inode %llu\n"), > - (int) (INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT), lino); > - if (!no_modify) > - *dirty += clear_dinode(mp, dino, lino); > - else > - *dirty = 1; > - *cleared = 1; > - *used = is_free; > - } else if (!uncertain) { > - do_warn(_("bad inode type %#o inode %llu\n"), > - (int) (INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT), lino); > - } > - return 1; > - } > - > - /* > - * type checks for root, realtime inodes, and quota inodes > - */ > - if (lino == mp->m_sb.sb_rootino && type != XR_INO_DIR) { > - do_warn(_("bad inode type for root inode %llu, "), lino); > - type = XR_INO_DIR; > - > - if (!no_modify) { > - do_warn(_("resetting to directory\n")); > - INT_MOD_EXPR(dinoc->di_mode, ARCH_CONVERT, > - &= ~(INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT)); > - INT_MOD_EXPR(dinoc->di_mode, ARCH_CONVERT, > - |= INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFDIR); > - } else { > - do_warn(_("would reset to directory\n")); > - } > - } else if (lino == mp->m_sb.sb_rsumino) { > - do_rt = 1; > - rstring = _("summary"); > - rtype = XR_INO_RTSUM; > - } else if (lino == mp->m_sb.sb_rbmino) { > - do_rt = 1; > - rstring = _("bitmap"); > - rtype = XR_INO_RTBITMAP; > - } else if (lino == mp->m_sb.sb_uquotino) { > - if (type != XR_INO_DATA) { > - do_warn(_("user quota inode has bad type 0x%x\n"), > - INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT); > - > - if (!no_modify) { > - *dirty += clear_dinode(mp, dino, lino); > - ASSERT(*dirty > 0); > - } > - > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - > - mp->m_sb.sb_uquotino = NULLFSINO; > - > - return(1); > - } > - } else if (lino == mp->m_sb.sb_gquotino) { > - if (type != XR_INO_DATA) { > - do_warn(_("group quota inode has bad type 0x%x\n"), > - INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT); > - > - if (!no_modify) { > - *dirty += clear_dinode(mp, dino, lino); > - ASSERT(*dirty > 0); > - } > - > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - > - mp->m_sb.sb_gquotino = NULLFSINO; > - > - return(1); > - } > - } > - > - if (do_rt && type != rtype) { > - type = XR_INO_DATA; > - > - do_warn(_("bad inode type for realtime %s inode %llu, "), > - rstring, lino); > - > - if (!no_modify) { > - do_warn(_("resetting to regular file\n")); > - INT_MOD_EXPR(dinoc->di_mode, ARCH_CONVERT, > - &= ~(INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT)); > - INT_MOD_EXPR(dinoc->di_mode, ARCH_CONVERT, > - |= INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFREG); > - } else { > - do_warn(_("would reset to regular file\n")); > - } > - } > - > - /* > - * only regular files with REALTIME or EXTSIZE flags set can have > - * extsize set, or directories with EXTSZINHERIT. > - */ > - if (INT_GET(dinoc->di_extsize, ARCH_CONVERT) != 0) { > - if ((type == XR_INO_RTDATA) || > - (type == XR_INO_DIR && > - (INT_GET(dinoc->di_flags, ARCH_CONVERT) & > - XFS_DIFLAG_EXTSZINHERIT)) || > - (type == XR_INO_DATA && > - (INT_GET(dinoc->di_flags, ARCH_CONVERT) & > - XFS_DIFLAG_EXTSIZE))) { > - /* s'okay */ ; > - } else { > - do_warn( > - _("bad non-zero extent size %u for non-realtime/extsize inode %llu, "), > - INT_GET(dinoc->di_extsize, ARCH_CONVERT), lino); > - > - if (!no_modify) { > - do_warn(_("resetting to zero\n")); > - dinoc->di_extsize = 0; > - *dirty = 1; > - } else { > - do_warn(_("would reset to zero\n")); > - } > - } > - } > - > - /* > - * for realtime inodes, check sizes to see that > - * they are consistent with the # of realtime blocks. > - * also, verify that they contain only one extent and > - * are extent format files. If anything's wrong, clear > - * the inode -- we'll recreate it in phase 6. > - */ > - if (do_rt && > - ((lino == mp->m_sb.sb_rbmino && > - INT_GET(dinoc->di_size, ARCH_CONVERT) > - != mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize) || > - (lino == mp->m_sb.sb_rsumino && > - INT_GET(dinoc->di_size, ARCH_CONVERT) != mp->m_rsumsize))) { > - > - do_warn(_("bad size %llu for realtime %s inode %llu\n"), > - INT_GET(dinoc->di_size, ARCH_CONVERT), rstring, lino); > - > - if (!no_modify) { > - *dirty += clear_dinode(mp, dino, lino); > - ASSERT(*dirty > 0); > - } > - > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - > - return(1); > - } > - > - if (do_rt && mp->m_sb.sb_rblocks == 0 && INT_GET(dinoc->di_nextents, ARCH_CONVERT) != 0) { > - do_warn(_("bad # of extents (%u) for realtime %s inode %llu\n"), > - INT_GET(dinoc->di_nextents, ARCH_CONVERT), rstring, lino); > - > - if (!no_modify) { > - *dirty += clear_dinode(mp, dino, lino); > - ASSERT(*dirty > 0); > - } > - > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - > - return(1); > - } > - > - /* > - * Setup nextents and anextents for blkmap_alloc calls. > - */ > - nextents = INT_GET(dinoc->di_nextents, ARCH_CONVERT); > - if (nextents > INT_GET(dinoc->di_nblocks, ARCH_CONVERT) || nextents > XFS_MAX_INCORE_EXTENTS) > - nextents = 1; > - anextents = INT_GET(dinoc->di_anextents, ARCH_CONVERT); > - if (anextents > INT_GET(dinoc->di_nblocks, ARCH_CONVERT) || anextents > XFS_MAX_INCORE_EXTENTS) > - anextents = 1; > - > - /* > - * general size/consistency checks: > - * > - * if the size <= size of the data fork, directories must be > - * local inodes unlike regular files which would be extent inodes. > - * all the other mentioned types have to have a zero size value. > - * > - * if the size and format don't match, get out now rather than > - * risk trying to process a non-existent extents or btree > - * type data fork. > - */ > - switch (type) { > - case XR_INO_DIR: > - if (INT_GET(dinoc->di_size, ARCH_CONVERT) <= > - XFS_DFORK_DSIZE(dino, mp) && > - (dinoc->di_format != XFS_DINODE_FMT_LOCAL)) { > - do_warn( > -_("mismatch between format (%d) and size (%lld) in directory ino %llu\n"), > - dinoc->di_format, > - INT_GET(dinoc->di_size, ARCH_CONVERT), > - lino); > - > - if (!no_modify) { > - *dirty += clear_dinode(mp, > - dino, lino); > - ASSERT(*dirty > 0); > - } > - > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - > - return(1); > - } > - if (dinoc->di_format != XFS_DINODE_FMT_LOCAL) > - dblkmap = blkmap_alloc(nextents); > - break; > - case XR_INO_SYMLINK: > - if (process_symlink_extlist(mp, lino, dino)) { > - do_warn(_("bad data fork in symlink %llu\n"), lino); > - > - if (!no_modify) { > - *dirty += clear_dinode(mp, > - dino, lino); > - ASSERT(*dirty > 0); > - } > - > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - > - return(1); > - } > - if (dinoc->di_format != XFS_DINODE_FMT_LOCAL) > - dblkmap = blkmap_alloc(nextents); > - break; > - case XR_INO_CHRDEV: /* fall through to FIFO case ... */ > - case XR_INO_BLKDEV: /* fall through to FIFO case ... */ > - case XR_INO_SOCK: /* fall through to FIFO case ... */ > - case XR_INO_MOUNTPOINT: /* fall through to FIFO case ... */ > - case XR_INO_FIFO: > - if (process_misc_ino_types(mp, dino, lino, type)) { > - if (!no_modify) { > - *dirty += clear_dinode(mp, dino, lino); > - ASSERT(*dirty > 0); > - } > - > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - > - return(1); > - } > - break; > - case XR_INO_RTDATA: > - /* > - * if we have no realtime blocks, any inode claiming > - * to be a real-time file is bogus > - */ > - if (mp->m_sb.sb_rblocks == 0) { > - do_warn( > - _("found inode %llu claiming to be a real-time file\n"), > - lino); > - > - if (!no_modify) { > - *dirty += clear_dinode(mp, dino, lino); > - ASSERT(*dirty > 0); > - } > - > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - > - return(1); > - } > - break; > - case XR_INO_RTBITMAP: > - if (INT_GET(dinoc->di_size, ARCH_CONVERT) != > - (__int64_t)mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize) { > - do_warn( > - _("realtime bitmap inode %llu has bad size %lld (should be %lld)\n"), > - lino, INT_GET(dinoc->di_size, ARCH_CONVERT), > - (__int64_t) mp->m_sb.sb_rbmblocks * > - mp->m_sb.sb_blocksize); > - > - if (!no_modify) { > - *dirty += clear_dinode(mp, dino, lino); > - ASSERT(*dirty > 0); > - } > - > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - > - return(1); > - } > - dblkmap = blkmap_alloc(nextents); > - break; > - case XR_INO_RTSUM: > - if (INT_GET(dinoc->di_size, ARCH_CONVERT) != mp->m_rsumsize) { > - do_warn( > - _("realtime summary inode %llu has bad size %lld (should be %d)\n"), > - lino, INT_GET(dinoc->di_size, ARCH_CONVERT), > - mp->m_rsumsize); > - > - if (!no_modify) { > - *dirty += clear_dinode(mp, dino, lino); > - ASSERT(*dirty > 0); > - } > - > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - > - return(1); > - } > - dblkmap = blkmap_alloc(nextents); > - break; > - default: > - break; > - } > - > - /* > - * check for illegal values of forkoff > - */ > - err = 0; > - if (dinoc->di_forkoff != 0) { > - switch (dinoc->di_format) { > - case XFS_DINODE_FMT_DEV: > - if (dinoc->di_forkoff != > - (roundup(sizeof(xfs_dev_t), 8) >> 3)) { > - do_warn( > - _("bad attr fork offset %d in dev inode %llu, should be %d\n"), > - (int) dinoc->di_forkoff, > - lino, > - (int) (roundup(sizeof(xfs_dev_t), 8) >> 3)); > - err = 1; > - } > - break; > - case XFS_DINODE_FMT_UUID: > - if (dinoc->di_forkoff != > - (roundup(sizeof(uuid_t), 8) >> 3)) { > - do_warn( > - _("bad attr fork offset %d in uuid inode %llu, should be %d\n"), > - (int) dinoc->di_forkoff, > - lino, > - (int)(roundup(sizeof(uuid_t), 8) >> 3)); > - err = 1; > - } > - break; > - case XFS_DINODE_FMT_LOCAL: /* fall through ... */ > - case XFS_DINODE_FMT_EXTENTS: /* fall through ... */ > - case XFS_DINODE_FMT_BTREE: { > - if (dinoc->di_forkoff >= (XFS_LITINO(mp) >> 3)) { > - do_warn( > - _("bad attr fork offset %d in inode %llu, max=%d\n"), > - (int) dinoc->di_forkoff, > - lino, XFS_LITINO(mp) >> 3); > - err = 1; > - } > - break; > - } > - default: > - do_error(_("unexpected inode format %d\n"), > - (int) dinoc->di_format); > - break; > - } > - } > - > - if (err) { > - if (!no_modify) { > - *dirty += clear_dinode(mp, dino, lino); > - ASSERT(*dirty > 0); > - } > - > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - blkmap_free(dblkmap); > - return(1); > - } > - > - /* > - * check data fork -- if it's bad, clear the inode > - */ > - nextents = 0; > switch (dinoc->di_format) { > case XFS_DINODE_FMT_LOCAL: > - err = process_lclinode(mp, agno, ino, dino, type, > - dirty, &totblocks, &nextents, &dblkmap, > - XFS_DATA_FORK, check_dups); > + err = process_lclinode(mp, agno, ino, dino, type, dirty, > + totblocks, nextents, dblkmap, XFS_DATA_FORK, > + check_dups); > break; > case XFS_DINODE_FMT_EXTENTS: > - err = process_exinode(mp, agno, ino, dino, type, > - dirty, &totblocks, &nextents, &dblkmap, > - XFS_DATA_FORK, check_dups); > + err = process_exinode(mp, agno, ino, dino, type, dirty, > + totblocks, nextents, dblkmap, XFS_DATA_FORK, > + check_dups); > break; > case XFS_DINODE_FMT_BTREE: > - err = process_btinode(mp, agno, ino, dino, type, > - dirty, &totblocks, &nextents, &dblkmap, > - XFS_DATA_FORK, check_dups); > + err = process_btinode(mp, agno, ino, dino, type, dirty, > + totblocks, nextents, dblkmap, XFS_DATA_FORK, > + check_dups); > break; > case XFS_DINODE_FMT_DEV: /* fall through */ > - case XFS_DINODE_FMT_UUID: > err = 0; > break; > default: > do_error(_("unknown format %d, ino %llu (mode = %d)\n"), > - dinoc->di_format, lino, > - INT_GET(dinoc->di_mode, ARCH_CONVERT)); > + dinoc->di_format, lino, be16_to_cpu(dinoc->di_mode)); > } > > if (err) { > - /* > - * problem in the data fork, clear out the inode > - * and get out > - */ > do_warn(_("bad data fork in inode %llu\n"), lino); > - > if (!no_modify) { > *dirty += clear_dinode(mp, dino, lino); > ASSERT(*dirty > 0); > } > - > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - blkmap_free(dblkmap); > - return(1); > + return 1; > } > > if (check_dups) { > @@ -2486,465 +2166,633 @@ _("mismatch between format (%d) and size > switch (dinoc->di_format) { > case XFS_DINODE_FMT_LOCAL: > err = process_lclinode(mp, agno, ino, dino, type, > - dirty, &totblocks, &nextents, &dblkmap, > + dirty, totblocks, nextents, dblkmap, > XFS_DATA_FORK, 0); > break; > case XFS_DINODE_FMT_EXTENTS: > err = process_exinode(mp, agno, ino, dino, type, > - dirty, &totblocks, &nextents, &dblkmap, > + dirty, totblocks, nextents, dblkmap, > XFS_DATA_FORK, 0); > break; > case XFS_DINODE_FMT_BTREE: > err = process_btinode(mp, agno, ino, dino, type, > - dirty, &totblocks, &nextents, &dblkmap, > + dirty, totblocks, nextents, dblkmap, > XFS_DATA_FORK, 0); > break; > case XFS_DINODE_FMT_DEV: /* fall through */ > - case XFS_DINODE_FMT_UUID: > err = 0; > break; > default: > do_error(_("unknown format %d, ino %llu (mode = %d)\n"), > dinoc->di_format, lino, > - INT_GET(dinoc->di_mode, ARCH_CONVERT)); > + be16_to_cpu(dinoc->di_mode)); > } > > - if (no_modify && err != 0) { > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - blkmap_free(dblkmap); > - return(1); > - } > + if (no_modify && err != 0) > + return 1; > > ASSERT(err == 0); > } > + return 0; > +} > > - /* > - * check attribute fork if necessary. attributes are > - * always stored in the regular filesystem. > - */ > +/* > + * Process extended attribute fork in inode > + */ > +static int > +process_inode_attr_fork( > + xfs_mount_t *mp, > + xfs_agnumber_t agno, > + xfs_agino_t ino, > + xfs_dinode_t *dino, > + int type, > + int *dirty, > + xfs_drfsbno_t *atotblocks, > + __uint64_t *anextents, > + int check_dups, > + int extra_attr_check, > + int *retval) > +{ > + xfs_dinode_core_t *dinoc = &dino->di_core; > + xfs_ino_t lino = XFS_AGINO_TO_INO(mp, agno, ino); > + blkmap_t *ablkmap = NULL; > + int repair = 0; > + int err; > + > + if (!XFS_DFORK_Q(dino)) { > + *anextents = 0; > + if (dinoc->di_aformat != XFS_DINODE_FMT_EXTENTS) { > + do_warn(_("bad attribute format %d in inode %llu, "), > + dinoc->di_aformat, lino); > + if (!no_modify) { > + do_warn(_("resetting value\n")); > + dinoc->di_aformat = XFS_DINODE_FMT_EXTENTS; > + *dirty = 1; > + } else > + do_warn(_("would reset value\n")); > + } > + return 0; > + } > > - if (!XFS_DFORK_Q(dino) && > - dinoc->di_aformat != XFS_DINODE_FMT_EXTENTS) { > - do_warn(_("bad attribute format %d in inode %llu, "), > - dinoc->di_aformat, lino); > - if (!no_modify) { > - do_warn(_("resetting value\n")); > - dinoc->di_aformat = XFS_DINODE_FMT_EXTENTS; > - *dirty = 1; > - } else > - do_warn(_("would reset value\n")); > - anextents = 0; > - } else if (XFS_DFORK_Q(dino)) { > + *anextents = be32_to_cpu(dinoc->di_anextents); > + if (*anextents > be64_to_cpu(dinoc->di_nblocks) || > + *anextents > XFS_MAX_INCORE_EXTENTS) > + *anextents = 1; > + > + switch (dinoc->di_aformat) { > + case XFS_DINODE_FMT_LOCAL: > + *anextents = 0; > + err = process_lclinode(mp, agno, ino, dino, type, dirty, > + atotblocks, anextents, &ablkmap, > + XFS_ATTR_FORK, check_dups); > + break; > + case XFS_DINODE_FMT_EXTENTS: > + ablkmap = blkmap_alloc(*anextents); > + *anextents = 0; > + err = process_exinode(mp, agno, ino, dino, type, dirty, > + atotblocks, anextents, &ablkmap, > + XFS_ATTR_FORK, check_dups); > + break; > + case XFS_DINODE_FMT_BTREE: > + ablkmap = blkmap_alloc(*anextents); > + *anextents = 0; > + err = process_btinode(mp, agno, ino, dino, type, dirty, > + atotblocks, anextents, &ablkmap, > + XFS_ATTR_FORK, check_dups); > + break; > + default: > + do_warn(_("illegal attribute format %d, ino %llu\n"), > + dinoc->di_aformat, lino); > + err = 1; > + break; > + } > + > + if (err) { > + /* > + * clear the attribute fork if necessary. we can't > + * clear the inode because we've already put the > + * inode space info into the blockmap. > + * > + * XXX - put the inode onto the "move it" list and > + * log the the attribute scrubbing > + */ > + do_warn(_("bad attribute fork in inode %llu"), lino); > + > + if (!no_modify) { > + if (delete_attr_ok) { > + do_warn(_(", clearing attr fork\n")); > + *dirty += clear_dinode_attr(mp, dino, lino); > + dinoc->di_aformat = XFS_DINODE_FMT_LOCAL; > + } else { > + do_warn("\n"); > + *dirty += clear_dinode(mp, dino, lino); > + } > + ASSERT(*dirty > 0); > + } else { > + do_warn(_(", would clear attr fork\n")); > + } > + > + *atotblocks = 0; > + *anextents = 0; > + blkmap_free(ablkmap); > + *retval = 1; > + > + return delete_attr_ok ? 0 : 1; > + } > + > + if (check_dups) { > switch (dinoc->di_aformat) { > case XFS_DINODE_FMT_LOCAL: > - anextents = 0; > err = process_lclinode(mp, agno, ino, dino, > - type, dirty, &atotblocks, &anextents, &ablkmap, > - XFS_ATTR_FORK, check_dups); > + type, dirty, atotblocks, anextents, > + &ablkmap, XFS_ATTR_FORK, 0); > break; > case XFS_DINODE_FMT_EXTENTS: > - ablkmap = blkmap_alloc(anextents); > - anextents = 0; > err = process_exinode(mp, agno, ino, dino, > - type, dirty, &atotblocks, &anextents, &ablkmap, > - XFS_ATTR_FORK, check_dups); > + type, dirty, atotblocks, anextents, > + &ablkmap, XFS_ATTR_FORK, 0); > break; > case XFS_DINODE_FMT_BTREE: > - ablkmap = blkmap_alloc(anextents); > - anextents = 0; > err = process_btinode(mp, agno, ino, dino, > - type, dirty, &atotblocks, &anextents, &ablkmap, > - XFS_ATTR_FORK, check_dups); > + type, dirty, atotblocks, anextents, > + &ablkmap, XFS_ATTR_FORK, 0); > break; > default: > - anextents = 0; > - do_warn(_("illegal attribute format %d, ino %llu\n"), > - dinoc->di_aformat, lino); > - err = 1; > - break; > + do_error(_("illegal attribute fmt %d, ino %llu\n"), > + dinoc->di_aformat, lino); > } > > - if (err) { > - /* > - * clear the attribute fork if necessary. we can't > - * clear the inode because we've already put the > - * inode space info into the blockmap. > - * > - * XXX - put the inode onto the "move it" list and > - * log the the attribute scrubbing > - */ > - do_warn(_("bad attribute fork in inode %llu"), lino); > + if (no_modify && err != 0) { > + blkmap_free(ablkmap); > + return 1; > + } > + > + ASSERT(err == 0); > + } > + > + /* > + * do attribute semantic-based consistency checks now > + */ > > + /* get this only in phase 3, not in both phase 3 and 4 */ > + if (extra_attr_check && > + process_attributes(mp, lino, dino, ablkmap, &repair)) { > + do_warn(_("problem with attribute contents in inode %llu\n"), > + lino); > + if (!repair) { > + /* clear attributes if not done already */ > if (!no_modify) { > - if (delete_attr_ok) { > - do_warn(_(", clearing attr fork\n")); > - *dirty += clear_dinode_attr(mp, > - dino, lino); > - } else { > - do_warn("\n"); > - *dirty += clear_dinode(mp, > - dino, lino); > - } > - ASSERT(*dirty > 0); > + *dirty += clear_dinode_attr(mp, dino, lino); > + dinoc->di_aformat = XFS_DINODE_FMT_LOCAL; > } else { > - do_warn(_(", would clear attr fork\n")); > + do_warn(_("would clear attr fork\n")); > } > + *atotblocks = 0; > + *anextents = 0; > + } > + else { > + *dirty = 1; /* it's been repaired */ > + } > + } > + blkmap_free(ablkmap); > + return 0; > +} > > - atotblocks = 0; > - anextents = 0; > +/* > + * check nlinks feature, if it's a version 1 inode, > + * just leave nlinks alone. even if it's set wrong, > + * it'll be reset when read in. > + */ > > - if (delete_attr_ok) { > - if (!no_modify) > - dinoc->di_aformat = XFS_DINODE_FMT_LOCAL; > +static int > +process_check_inode_nlink_version( > + xfs_dinode_core_t *dinoc, > + xfs_ino_t lino) > +{ > + int dirty = 0; > + > + if (dinoc->di_version > XFS_DINODE_VERSION_1 && !fs_inode_nlink) { > + /* > + * do we have a fs/inode version mismatch with a valid > + * version 2 inode here that has to stay version 2 or > + * lose links? > + */ > + if (be32_to_cpu(dinoc->di_nlink) > XFS_MAXLINK_1) { > + /* > + * yes. are nlink inodes allowed? > + */ > + if (fs_inode_nlink_allowed) { > + /* > + * yes, update status variable which will > + * cause sb to be updated later. > + */ > + fs_inode_nlink = 1; > + do_warn(_("version 2 inode %llu claims > %u links, "), > + lino, XFS_MAXLINK_1); > + if (!no_modify) { > + do_warn(_("updating superblock " > + "version number\n")); > + } else { > + do_warn(_("would update superblock " > + "version number\n")); > + } > } else { > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - blkmap_free(dblkmap); > - blkmap_free(ablkmap); > + /* > + * no, have to convert back to onlinks > + * even if we lose some links > + */ > + do_warn(_("WARNING: version 2 inode %llu " > + "claims > %u links, "), > + lino, XFS_MAXLINK_1); > + if (!no_modify) { > + do_warn(_("converting back to version 1,\n" > + "this may destroy %d links\n"), > + be32_to_cpu(dinoc->di_nlink) - > + XFS_MAXLINK_1); > + > + dinoc->di_version = XFS_DINODE_VERSION_1; > + dinoc->di_nlink = cpu_to_be32(XFS_MAXLINK_1); > + dinoc->di_onlink = cpu_to_be16(XFS_MAXLINK_1); > + dirty = 1; > + } else { > + do_warn(_("would convert back to version 1,\n" > + "\tthis might destroy %d links\n"), > + be32_to_cpu(dinoc->di_nlink) - > + XFS_MAXLINK_1); > + } > } > - return(1); > + } else { > + /* > + * do we have a v2 inode that we could convert back > + * to v1 without losing any links? if we do and > + * we have a mismatch between superblock bits and the > + * version bit, alter the version bit in this case. > + * > + * the case where we lost links was handled above. > + */ > + do_warn(_("found version 2 inode %llu, "), lino); > + if (!no_modify) { > + do_warn(_("converting back to version 1\n")); > + dinoc->di_version = XFS_DINODE_VERSION_1; > + dinoc->di_onlink = cpu_to_be16( > + be32_to_cpu(dinoc->di_nlink)); > + dirty = 1; > + } else { > + do_warn(_("would convert back to version 1\n")); > + } > + } > + } > > - } else if (check_dups) { > - switch (dinoc->di_aformat) { > - case XFS_DINODE_FMT_LOCAL: > - err = process_lclinode(mp, agno, ino, dino, > - type, dirty, &atotblocks, &anextents, > - &ablkmap, XFS_ATTR_FORK, 0); > - break; > - case XFS_DINODE_FMT_EXTENTS: > - err = process_exinode(mp, agno, ino, dino, > - type, dirty, &atotblocks, &anextents, > - &ablkmap, XFS_ATTR_FORK, 0); > - break; > - case XFS_DINODE_FMT_BTREE: > - err = process_btinode(mp, agno, ino, dino, > - type, dirty, &atotblocks, &anextents, > - &ablkmap, XFS_ATTR_FORK, 0); > - break; > - default: > - do_error( > - _("illegal attribute fmt %d, ino %llu\n"), > - dinoc->di_aformat, lino); > + /* > + * ok, if it's still a version 2 inode, it's going > + * to stay a version 2 inode. it should have a zero > + * onlink field, so clear it. > + */ > + if (dinoc->di_version > XFS_DINODE_VERSION_1 && > + dinoc->di_onlink != 0 && fs_inode_nlink > 0) { > + if (!no_modify) { > + do_warn(_("clearing obsolete nlink field in " > + "version 2 inode %llu, was %d, now 0\n"), > + lino, be16_to_cpu(dinoc->di_onlink)); > + dinoc->di_onlink = 0; > + dirty = 1; > + } else { > + do_warn(_("would clear obsolete nlink field in " > + "version 2 inode %llu, currently %d\n"), > + lino, be16_to_cpu(dinoc->di_onlink)); > + } > + } > + return dirty; > +} > + > +/* > + * returns 0 if the inode is ok, 1 if the inode is corrupt > + * check_dups can be set to 1 *only* when called by the > + * first pass of the duplicate block checking of phase 4. > + * *dirty is set > 0 if the dinode has been altered and > + * needs to be written out. > + * > + * for detailed, info, look at process_dinode() comments. > + */ > +/* ARGSUSED */ > +int > +process_dinode_int(xfs_mount_t *mp, > + xfs_dinode_t *dino, > + xfs_agnumber_t agno, > + xfs_agino_t ino, > + int was_free, /* 1 if inode is currently free */ > + int *dirty, /* out == > 0 if inode is now dirty */ > + int *used, /* out == 1 if inode is in use */ > + int verify_mode, /* 1 == verify but don't modify inode */ > + int uncertain, /* 1 == inode is uncertain */ > + int ino_discovery, /* 1 == check dirs for unknown inodes */ > + int check_dups, /* 1 == check if inode claims > + * duplicate blocks */ > + int extra_attr_check, /* 1 == do attribute format and value checks */ > + int *isa_dir, /* out == 1 if inode is a directory */ > + xfs_ino_t *parent) /* out -- parent if ino is a dir */ > +{ > + xfs_drfsbno_t totblocks = 0; > + xfs_drfsbno_t atotblocks = 0; > + xfs_dinode_core_t *dinoc; > + int di_mode; > + int type; > + int retval = 0; > + __uint64_t nextents; > + __uint64_t anextents; > + xfs_ino_t lino; > + const int is_free = 0; > + const int is_used = 1; > + blkmap_t *dblkmap = NULL; > + > + *dirty = *isa_dir = 0; > + *used = is_used; > + type = XR_INO_UNKNOWN; > + > + dinoc = &dino->di_core; > + lino = XFS_AGINO_TO_INO(mp, agno, ino); > + di_mode = be16_to_cpu(dinoc->di_mode); > + > + /* > + * if in verify mode, don't modify the inode. > + * > + * if correcting, reset stuff that has known values > + * > + * if in uncertain mode, be silent on errors since we're > + * trying to find out if these are inodes as opposed > + * to assuming that they are. Just return the appropriate > + * return code in that case. > + * > + * If uncertain is set, verify_mode MUST be set. > + */ > + ASSERT(uncertain == 0 || verify_mode != 0); > + > + if (be16_to_cpu(dinoc->di_magic) != XFS_DINODE_MAGIC) { > + retval = 1; > + if (!uncertain) > + do_warn(_("bad magic number 0x%x on inode %llu\n"), > + be16_to_cpu(dinoc->di_magic), lino); > + if (!verify_mode) { > + if (!no_modify) { > + do_warn(_("resetting magic number\n")); > + dinoc->di_magic = cpu_to_be16(XFS_DINODE_MAGIC); > + *dirty = 1; > + } else > + do_warn(_("would reset magic number\n")); > + } > + } > + > + if (!XFS_DINODE_GOOD_VERSION(dinoc->di_version) || > + (!fs_inode_nlink && dinoc->di_version > XFS_DINODE_VERSION_1)) { > + retval = 1; > + if (!uncertain) > + do_warn(_("bad version number 0x%x on inode %llu, "), > + dinoc->di_version, lino); > + if (!verify_mode) { > + if (!no_modify) { > + do_warn(_("resetting version number\n")); > + dinoc->di_version = (fs_inode_nlink) ? > + XFS_DINODE_VERSION_2 : > + XFS_DINODE_VERSION_1; > + *dirty = 1; > + } else > + do_warn(_("would reset version number\n")); > + } > + } > + > + /* > + * blow out of here if the inode size is < 0 > + */ > + if ((xfs_fsize_t)be64_to_cpu(dinoc->di_size) < 0) { > + if (!uncertain) > + do_warn(_("bad (negative) size %lld on inode %llu\n"), > + be64_to_cpu(dinoc->di_size), lino); > + if (verify_mode) > + return 1; > + goto clear_bad_out; > + } > + > + /* > + * if not in verify mode, check to sii if the inode and imap > + * agree that the inode is free > + */ > + if (!verify_mode && di_mode == 0) { > + /* > + * was_free value is not meaningful if we're in verify mode > + */ > + if (was_free) { > + /* > + * easy case, inode free -- inode and map agree, clear > + * it just in case to ensure that format, etc. are > + * set correctly > + */ > + if (!no_modify) > + *dirty += clear_dinode(mp, dino, lino); > + *used = is_free; > + return 0; > + } > + /* > + * the inode looks free but the map says it's in use. > + * clear the inode just to be safe and mark the inode > + * free. > + */ > + do_warn(_("imap claims a free inode %llu is in use, "), lino); > + if (!no_modify) { > + do_warn(_("correcting imap and clearing inode\n")); > + if (clear_dinode(mp, dino, lino)) { > + retval = 1; > + *dirty = 1; > } > + } else > + do_warn(_("would correct imap and clear inode\n")); > + *used = is_free; > + return retval; > + } > > - if (no_modify && err != 0) { > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - blkmap_free(dblkmap); > - blkmap_free(ablkmap); > - return(1); > - } > + /* > + * because of the lack of any write ordering guarantee, it's > + * possible that the core got updated but the forks didn't. > + * so rather than be ambitious (and probably incorrect), > + * if there's an inconsistency, we get conservative and > + * just pitch the file. blow off checking formats of > + * free inodes since technically any format is legal > + * as we reset the inode when we re-use it. > + */ > + if (di_mode != 0 && check_dinode_mode_format(dinoc) != 0) { > + if (!uncertain) > + do_warn(_("bad inode format in inode %llu\n"), lino); > + if (verify_mode) > + return 1; > + goto clear_bad_out; > + } > > - ASSERT(err == 0); > - } > + if (verify_mode) > + return retval; > > - /* > - * do attribute semantic-based consistency checks now > - */ > + /* > + * clear the next unlinked field if necessary on a good > + * inode only during phase 4 -- when checking for inodes > + * referencing duplicate blocks. then it's safe because > + * we've done the inode discovery and have found all the inodes > + * we're going to find. check_dups is set to 1 only during > + * phase 4. Ugly. > + */ > + if (check_dups && !no_modify) > + *dirty += clear_dinode_unlinked(mp, dino); > > - /* get this only in phase 3, not in both phase 3 and 4 */ > - if (extra_attr_check) { > - if ((err = process_attributes(mp, lino, dino, ablkmap, > - &repair))) { > - do_warn( > - _("problem with attribute contents in inode %llu\n"), lino); > - if(!repair) { > - /* clear attributes if not done already */ > - if (!no_modify) { > - *dirty += clear_dinode_attr( > - mp, dino, lino); > - dinoc->di_aformat = > - XFS_DINODE_FMT_LOCAL; > - } else { > - do_warn( > - _("would clear attr fork\n")); > - } > - atotblocks = 0; > - anextents = 0; > - } > - else { > - *dirty = 1; /* it's been repaired */ > - } > - } > - } > - blkmap_free(ablkmap); > + /* set type and map type info */ > > - } else > - anextents = 0; > + switch (di_mode & S_IFMT) { > + case S_IFDIR: > + type = XR_INO_DIR; > + *isa_dir = 1; > + break; > + case S_IFREG: > + if (be16_to_cpu(dinoc->di_flags) & XFS_DIFLAG_REALTIME) > + type = XR_INO_RTDATA; > + else if (lino == mp->m_sb.sb_rbmino) > + type = XR_INO_RTBITMAP; > + else if (lino == mp->m_sb.sb_rsumino) > + type = XR_INO_RTSUM; > + else > + type = XR_INO_DATA; > + break; > + case S_IFLNK: > + type = XR_INO_SYMLINK; > + break; > + case S_IFCHR: > + type = XR_INO_CHRDEV; > + break; > + case S_IFBLK: > + type = XR_INO_BLKDEV; > + break; > + case S_IFSOCK: > + type = XR_INO_SOCK; > + break; > + case S_IFIFO: > + type = XR_INO_FIFO; > + break; > + default: > + do_warn(_("bad inode type %#o inode %llu\n"), > + di_mode & S_IFMT, lino); > + goto clear_bad_out; > + } > > /* > - * enforce totblocks is 0 for misc types > - */ > - if (process_misc_ino_types_blocks(totblocks, lino, type)) { > - if (!no_modify) { > - *dirty += clear_dinode(mp, dino, lino); > - ASSERT(*dirty > 0); > - } > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - blkmap_free(dblkmap); > - return(1); > - } > + * type checks for superblock inodes > + */ > + if (process_check_sb_inodes(mp, dinoc, lino, &type, dirty) != 0) > + goto clear_bad_out; > > /* > - * correct space counters if required > + * only regular files with REALTIME or EXTSIZE flags set can have > + * extsize set, or directories with EXTSZINHERIT. > */ > - if (totblocks + atotblocks != INT_GET(dinoc->di_nblocks, ARCH_CONVERT)) { > - if (!no_modify) { > - do_warn( > - _("correcting nblocks for inode %llu, was %llu - counted %llu\n"), > - lino, INT_GET(dinoc->di_nblocks, ARCH_CONVERT), > - totblocks + atotblocks); > - *dirty = 1; > - INT_SET(dinoc->di_nblocks, ARCH_CONVERT, totblocks + atotblocks); > - } else { > - do_warn( > - _("bad nblocks %llu for inode %llu, would reset to %llu\n"), > - INT_GET(dinoc->di_nblocks, ARCH_CONVERT), lino, > - totblocks + atotblocks); > + if (dinoc->di_extsize != 0) { > + if ((type == XR_INO_RTDATA) || > + (type == XR_INO_DIR && (be16_to_cpu(dinoc->di_flags) & > + XFS_DIFLAG_EXTSZINHERIT)) || > + (type == XR_INO_DATA && (be16_to_cpu(dinoc->di_flags) & > + XFS_DIFLAG_EXTSIZE))) { > + /* s'okay */ ; > + } else { > + do_warn(_("bad non-zero extent size %u for " > + "non-realtime/extsize inode %llu, "), > + be32_to_cpu(dinoc->di_extsize), lino); > + if (!no_modify) { > + do_warn(_("resetting to zero\n")); > + dinoc->di_extsize = 0; > + *dirty = 1; > + } else > + do_warn(_("would reset to zero\n")); > } > } > > - if (nextents > MAXEXTNUM) { > - do_warn(_("too many data fork extents (%llu) in inode %llu\n"), > - nextents, lino); > + /* > + * general size/consistency checks: > + */ > + if (process_check_inode_sizes(mp, dino, lino, type) != 0) > + goto clear_bad_out; > > - if (!no_modify) { > - *dirty += clear_dinode(mp, dino, lino); > - ASSERT(*dirty > 0); > - } > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - blkmap_free(dblkmap); > + /* > + * check for illegal values of forkoff > + */ > + if (process_check_inode_forkoff(mp, dinoc, lino) != 0) > + goto clear_bad_out; > > - return(1); > - } > - if (nextents != INT_GET(dinoc->di_nextents, ARCH_CONVERT)) { > - if (!no_modify) { > - do_warn( > - _("correcting nextents for inode %llu, was %d - counted %llu\n"), > - lino, INT_GET(dinoc->di_nextents, ARCH_CONVERT), > - nextents); > - *dirty = 1; > - INT_SET(dinoc->di_nextents, ARCH_CONVERT, > - (xfs_extnum_t) nextents); > - } else { > - do_warn( > - _("bad nextents %d for inode %llu, would reset to %llu\n"), > - INT_GET(dinoc->di_nextents, ARCH_CONVERT), > - lino, nextents); > - } > - } > + /* > + * check data fork -- if it's bad, clear the inode > + */ > + if (process_inode_data_fork(mp, agno, ino, dino, type, dirty, > + &totblocks, &nextents, &dblkmap, check_dups) != 0) > + goto bad_out; > > - if (anextents > MAXAEXTNUM) { > - do_warn(_("too many attr fork extents (%llu) in inode %llu\n"), > - anextents, lino); > + /* > + * check attribute fork if necessary. attributes are > + * always stored in the regular filesystem. > + */ > + if (process_inode_attr_fork(mp, agno, ino, dino, type, dirty, > + &atotblocks, &anextents, check_dups, extra_attr_check, > + &retval)) > + goto bad_out; > > - if (!no_modify) { > - *dirty += clear_dinode(mp, dino, lino); > - ASSERT(*dirty > 0); > - } > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - blkmap_free(dblkmap); > - return(1); > - } > - if (anextents != INT_GET(dinoc->di_anextents, ARCH_CONVERT)) { > - if (!no_modify) { > - do_warn( > - _("correcting anextents for inode %llu, was %d - counted %llu\n"), > - lino, > - INT_GET(dinoc->di_anextents, ARCH_CONVERT), > - anextents); > - *dirty = 1; > - INT_SET(dinoc->di_anextents, ARCH_CONVERT, > - (xfs_aextnum_t) anextents); > - } else { > - do_warn( > - _("bad anextents %d for inode %llu, would reset to %llu\n"), > - INT_GET(dinoc->di_anextents, ARCH_CONVERT), > - lino, anextents); > - } > - } > + /* > + * enforce totblocks is 0 for misc types > + */ > + if (process_misc_ino_types_blocks(totblocks, lino, type)) > + goto clear_bad_out; > + > + /* > + * correct space counters if required > + */ > + if (process_inode_blocks_and_extents(dinoc, totblocks + atotblocks, > + nextents, anextents, lino, dirty) != 0) > + goto clear_bad_out; > > /* > * do any semantic type-based checking here > */ > switch (type) { > case XR_INO_DIR: > - if (XFS_SB_VERSION_HASDIRV2(&mp->m_sb)) > - err = process_dir2(mp, lino, dino, ino_discovery, > - dirty, "", parent, dblkmap); > - else > - err = process_dir(mp, lino, dino, ino_discovery, > - dirty, "", parent, dblkmap); > - if (err) > - do_warn( > - _("problem with directory contents in inode %llu\n"), > - lino); > - break; > - case XR_INO_RTBITMAP: > - /* process_rtbitmap XXX */ > - err = 0; > - break; > - case XR_INO_RTSUM: > - /* process_rtsummary XXX */ > - err = 0; > + if (process_dir2(mp, lino, dino, ino_discovery, dirty, "", > + parent, dblkmap) != 0) { > + do_warn(_("problem with directory contents in " > + "inode %llu\n"), lino); > + goto clear_bad_out; > + } > break; > case XR_INO_SYMLINK: > - if ((err = process_symlink(mp, lino, dino, dblkmap))) > + if (process_symlink(mp, lino, dino, dblkmap) != 0) { > do_warn(_("problem with symbolic link in inode %llu\n"), > lino); > - break; > - case XR_INO_DATA: /* fall through to FIFO case ... */ > - case XR_INO_RTDATA: /* fall through to FIFO case ... */ > - case XR_INO_CHRDEV: /* fall through to FIFO case ... */ > - case XR_INO_BLKDEV: /* fall through to FIFO case ... */ > - case XR_INO_SOCK: /* fall through to FIFO case ... */ > - case XR_INO_FIFO: > - err = 0; > + goto clear_bad_out; > + } > break; > default: > - printf(_("Unexpected inode type\n")); > - abort(); > + break; > } > > - if (dblkmap) > - blkmap_free(dblkmap); > - > - if (err) { > - /* > - * problem in the inode type-specific semantic > - * checking, clear out the inode and get out > - */ > - if (!no_modify) { > - *dirty += clear_dinode(mp, dino, lino); > - ASSERT(*dirty > 0); > - } > - *cleared = 1; > - *used = is_free; > - *isa_dir = 0; > - > - return(1); > - } > + blkmap_free(dblkmap); > > /* > * check nlinks feature, if it's a version 1 inode, > * just leave nlinks alone. even if it's set wrong, > * it'll be reset when read in. > */ > - if (dinoc->di_version > XFS_DINODE_VERSION_1 && !fs_inode_nlink) { > - /* > - * do we have a fs/inode version mismatch with a valid > - * version 2 inode here that has to stay version 2 or > - * lose links? > - */ > - if (INT_GET(dinoc->di_nlink, ARCH_CONVERT) > XFS_MAXLINK_1) { > - /* > - * yes. are nlink inodes allowed? > - */ > - if (fs_inode_nlink_allowed) { > - /* > - * yes, update status variable which will > - * cause sb to be updated later. > - */ > - fs_inode_nlink = 1; > - do_warn( > - _("version 2 inode %llu claims > %u links, "), > - lino, XFS_MAXLINK_1); > - if (!no_modify) { > - do_warn( > - _("updating superblock version number\n")); > - } else { > - do_warn( > - _("would update superblock version number\n")); > - } > - } else { > - /* > - * no, have to convert back to onlinks > - * even if we lose some links > - */ > - do_warn( > - _("WARNING: version 2 inode %llu claims > %u links, "), > - lino, XFS_MAXLINK_1); > - if (!no_modify) { > - do_warn( > - _("converting back to version 1,\n\tthis may destroy %d links\n"), > - INT_GET(dinoc->di_nlink, > - ARCH_CONVERT) > - - XFS_MAXLINK_1); > - > - dinoc->di_version = > - XFS_DINODE_VERSION_1; > - INT_SET(dinoc->di_nlink, ARCH_CONVERT, > - XFS_MAXLINK_1); > - INT_SET(dinoc->di_onlink, ARCH_CONVERT, > - XFS_MAXLINK_1); > - > - *dirty = 1; > - } else { > - do_warn( > - _("would convert back to version 1,\n\tthis might destroy %d links\n"), > - INT_GET(dinoc->di_nlink, > - ARCH_CONVERT) > - - XFS_MAXLINK_1); > - } > - } > - } else { > - /* > - * do we have a v2 inode that we could convert back > - * to v1 without losing any links? if we do and > - * we have a mismatch between superblock bits and the > - * version bit, alter the version bit in this case. > - * > - * the case where we lost links was handled above. > - */ > - do_warn(_("found version 2 inode %llu, "), lino); > - if (!no_modify) { > - do_warn(_("converting back to version 1\n")); > - > - dinoc->di_version = > - XFS_DINODE_VERSION_1; > - INT_SET(dinoc->di_onlink, ARCH_CONVERT, > - INT_GET(dinoc->di_nlink, ARCH_CONVERT)); > - > - *dirty = 1; > - } else { > - do_warn(_("would convert back to version 1\n")); > - } > - } > - } > + *dirty = process_check_inode_nlink_version(dinoc, lino); > > - /* > - * ok, if it's still a version 2 inode, it's going > - * to stay a version 2 inode. it should have a zero > - * onlink field, so clear it. > - */ > - if (dinoc->di_version > XFS_DINODE_VERSION_1 && > - INT_GET(dinoc->di_onlink, ARCH_CONVERT) > 0 && > - fs_inode_nlink > 0) { > - if (!no_modify) { > - do_warn( > -_("clearing obsolete nlink field in version 2 inode %llu, was %d, now 0\n"), > - lino, INT_GET(dinoc->di_onlink, ARCH_CONVERT)); > - dinoc->di_onlink = 0; > - *dirty = 1; > - } else { > - do_warn( > -_("would clear obsolete nlink field in version 2 inode %llu, currently %d\n"), > - lino, INT_GET(dinoc->di_onlink, ARCH_CONVERT)); > - *dirty = 1; > - } > - } > + return retval; > > - return(retval > 0 ? 1 : 0); > +clear_bad_out: > + if (!no_modify) { > + *dirty += clear_dinode(mp, dino, lino); > + ASSERT(*dirty > 0); > + } > +bad_out: > + *used = is_free; > + *isa_dir = 0; > + blkmap_free(dblkmap); > + return 1; > } > > /* > @@ -2983,8 +2831,6 @@ _("would clear obsolete nlink field in v > * claimed blocks using the bitmap. > * Outs: > * dirty -- whether we changed the inode (1 == yes) > - * cleared -- whether we cleared the inode (1 == yes). In > - * no modify mode, if we would have cleared it > * used -- 1 if the inode is used, 0 if free. In no modify > * mode, whether the inode should be used or free > * isa_dir -- 1 if the inode is a directory, 0 if not. In > @@ -2994,30 +2840,29 @@ _("would clear obsolete nlink field in v > */ > > int > -process_dinode(xfs_mount_t *mp, > - xfs_dinode_t *dino, > - xfs_agnumber_t agno, > - xfs_agino_t ino, > - int was_free, > - int *dirty, > - int *cleared, > - int *used, > - int ino_discovery, > - int check_dups, > - int extra_attr_check, > - int *isa_dir, > - xfs_ino_t *parent) > +process_dinode( > + xfs_mount_t *mp, > + xfs_dinode_t *dino, > + xfs_agnumber_t agno, > + xfs_agino_t ino, > + int was_free, > + int *dirty, > + int *used, > + int ino_discovery, > + int check_dups, > + int extra_attr_check, > + int *isa_dir, > + xfs_ino_t *parent) > { > - const int verify_mode = 0; > - const int uncertain = 0; > + const int verify_mode = 0; > + const int uncertain = 0; > > #ifdef XR_INODE_TRACE > fprintf(stderr, "processing inode %d/%d\n", agno, ino); > #endif > - return(process_dinode_int(mp, dino, agno, ino, was_free, dirty, > - cleared, used, verify_mode, uncertain, > - ino_discovery, check_dups, extra_attr_check, > - isa_dir, parent)); > + return process_dinode_int(mp, dino, agno, ino, was_free, dirty, used, > + verify_mode, uncertain, ino_discovery, > + check_dups, extra_attr_check, isa_dir, parent); > } > > /* > @@ -3027,25 +2872,24 @@ process_dinode(xfs_mount_t *mp, > * if the inode passes the cursory sanity check, 1 otherwise. > */ > int > -verify_dinode(xfs_mount_t *mp, > - xfs_dinode_t *dino, > - xfs_agnumber_t agno, > - xfs_agino_t ino) > -{ > - xfs_ino_t parent; > - int cleared = 0; > - int used = 0; > - int dirty = 0; > - int isa_dir = 0; > - const int verify_mode = 1; > - const int check_dups = 0; > - const int ino_discovery = 0; > - const int uncertain = 0; > - > - return(process_dinode_int(mp, dino, agno, ino, 0, &dirty, > - &cleared, &used, verify_mode, > - uncertain, ino_discovery, check_dups, > - 0, &isa_dir, &parent)); > +verify_dinode( > + xfs_mount_t *mp, > + xfs_dinode_t *dino, > + xfs_agnumber_t agno, > + xfs_agino_t ino) > +{ > + xfs_ino_t parent; > + int used = 0; > + int dirty = 0; > + int isa_dir = 0; > + const int verify_mode = 1; > + const int check_dups = 0; > + const int ino_discovery = 0; > + const int uncertain = 0; > + > + return process_dinode_int(mp, dino, agno, ino, 0, &dirty, &used, > + verify_mode, uncertain, ino_discovery, > + check_dups, 0, &isa_dir, &parent); > } > > /* > @@ -3054,23 +2898,22 @@ verify_dinode(xfs_mount_t *mp, > * returns 0 if the inode passes the cursory sanity check, 1 otherwise. > */ > int > -verify_uncertain_dinode(xfs_mount_t *mp, > - xfs_dinode_t *dino, > - xfs_agnumber_t agno, > - xfs_agino_t ino) > -{ > - xfs_ino_t parent; > - int cleared = 0; > - int used = 0; > - int dirty = 0; > - int isa_dir = 0; > - const int verify_mode = 1; > - const int check_dups = 0; > - const int ino_discovery = 0; > - const int uncertain = 1; > - > - return(process_dinode_int(mp, dino, agno, ino, 0, &dirty, > - &cleared, &used, verify_mode, > - uncertain, ino_discovery, check_dups, > - 0, &isa_dir, &parent)); > +verify_uncertain_dinode( > + xfs_mount_t *mp, > + xfs_dinode_t *dino, > + xfs_agnumber_t agno, > + xfs_agino_t ino) > +{ > + xfs_ino_t parent; > + int used = 0; > + int dirty = 0; > + int isa_dir = 0; > + const int verify_mode = 1; > + const int check_dups = 0; > + const int ino_discovery = 0; > + const int uncertain = 1; > + > + return process_dinode_int(mp, dino, agno, ino, 0, &dirty, &used, > + verify_mode, uncertain, ino_discovery, > + check_dups, 0, &isa_dir, &parent); > } > > =========================================================================== > xfsprogs/repair/dinode.h > =========================================================================== > > --- a/xfsprogs/repair/dinode.h 2007-11-15 17:24:33.000000000 +1100 > +++ b/xfsprogs/repair/dinode.h 2007-11-15 17:22:18.290409320 +1100 > @@ -84,7 +84,6 @@ process_dinode(xfs_mount_t *mp, > xfs_agino_t ino, > int was_free, > int *dirty, > - int *tossit, > int *used, > int check_dirs, > int check_dups, From owner-xfs@oss.sgi.com Tue Jan 15 18:26:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 18:26:53 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: **** X-Spam-Status: No, score=4.0 required=5.0 tests=BAYES_99,MISSING_MIMEOLE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0G2Qld1029113 for ; Tue, 15 Jan 2008 18:26:48 -0800 X-ASG-Debug-ID: 1200450418-17e6021d0000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from arsat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 88B91C52615 for ; Tue, 15 Jan 2008 18:26:59 -0800 (PST) Received: from arsat.com (103.185-225-89.dsl.completel.net [89.225.185.103]) by cuda.sgi.com with SMTP id zxeHKCRWmnib7LRc for ; Tue, 15 Jan 2008 18:26:59 -0800 (PST) Received: from cuda-allmx.sgi.com by 89.225.185.103 (Postfix) with ESMTP id 31fnLeTJ77Sp for ; Wed, 16 Jan 2008 04:23:40 +0100 Received: from (root@localhost) by cuda-allmx.sgi.com (8.9.3/8.9.3) id f1ofZ3woF36u for ; Wed, 16 Jan 2008 04:23:40 +0100 From: "Della Hope" Reply-To: "Della Hope" Message-ID: <0927609844.1418275255@arsat.com> Date: Wed, 16 Jan 2008 04:23:40 +0100 To: X-ASG-Orig-Subj: Amateur dildoing her big pussy Subject: ***** SUSPECTED SPAM ***** Amateur dildoing her big pussy MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 080115-0, 15/01/2008), Outbound message X-Antivirus-Status: Clean X-Barracuda-Connect: 103.185-225-89.dsl.completel.net[89.225.185.103] X-Barracuda-Start-Time: 1200450425 X-Barracuda-Bayes: INNOCENT GLOBAL 0.3423 1.0000 -0.1804 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 2.61 X-Barracuda-Spam-Status: Yes, SCORE=2.61 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=SARE_ADLTSUB2, SARE_ADULT2, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39639 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.80 SARE_ADLTSUB2 Contains possible adult words 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 0.99 SARE_ADULT2 BODY: Contains adult material X-Priority: 5 (Lowest) X-MSMail-Priority: Low Importance: Low X-Barracuda-Spam-Flag: YES X-Virus-Scanned: ClamAV 0.91.2/5484/Tue Jan 15 11:31:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14139 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dianeqacm@arsat.com Precedence: bulk X-list: xfs GreatAttract dot com hemophiliac oarhole ankylotomy sambas inviscate antihistamine vancourier spret disestablishes precyclonic prorecognition stillmen sclerobase diazin pink peacockishness cajoles bowed From owner-xfs@oss.sgi.com Tue Jan 15 18:33:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 18:33:11 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0G2Wvpa029749 for ; Tue, 15 Jan 2008 18:33:00 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA22564; Wed, 16 Jan 2008 13:33:10 +1100 Date: Wed, 16 Jan 2008 13:33:50 +1100 To: "Chandan Talukdar" Subject: Re: [REVIEW] Refactor xfs_repair's process_dinode_int From: "Barry Naujok" Organization: SGI Cc: "xfs@oss.sgi.com" Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <4782B72D.8070208@agami.com> <47833C0F.6070206@agami.com> <478D1899.9080201@agami.com> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5484/Tue Jan 15 11:31:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14140 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Wed, 16 Jan 2008 11:51:21 +1100, Barry Naujok wrote: > On Wed, 16 Jan 2008 07:33:29 +1100, Chandan Talukdar > wrote: > >> Hi Barry, >> >> - In process_dinode_int(), we should be checking for 'dblkmap' not >> being NULL before freeing it. There are a few error conditions which >> can cause the control to go to 'clear_bad_out' with dblkmap being NULL. > > freeing a NULL is valid My bad! Yes, blkmap_free() doesn't check for a NULL pointer before going through the structure. I'll fix this up. Regards, Barry. From owner-xfs@oss.sgi.com Tue Jan 15 19:10:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 19:10:59 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0G3AkX2031981 for ; Tue, 15 Jan 2008 19:10:50 -0800 Received: from timothy-shimmins-power-mac-g5.local (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA23648; Wed, 16 Jan 2008 14:10:55 +1100 Message-ID: <478D75C2.5010004@sgi.com> Date: Wed, 16 Jan 2008 14:10:58 +1100 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Barry Naujok CC: Chandan Talukdar , "xfs@oss.sgi.com" Subject: Re: [REVIEW] Refactor xfs_repair's process_dinode_int References: <4782B72D.8070208@agami.com> <47833C0F.6070206@agami.com> <478D1899.9080201@agami.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/5484/Tue Jan 15 11:31:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14141 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Not that it is a big deal....but my 2 cents... Barry Naujok wrote: > On Wed, 16 Jan 2008 07:33:29 +1100, Chandan Talukdar > wrote: > >> Hi Barry, >> >> - In process_misc_ino_types(), dino->di_core.di_size is being accessed >> without being converted to machine format. The check is being >> performed against 0; so, it should be fine. But for better code >> readability, I guess it should be accessed through be64_to_cpu(). > > Yeah... sort of in two-minds about this one. > Well, traditionally we would not be endian converting it. We don't endian convert things which are compared to zero or are only 1 byte. There are a bunch of examples in the kernel code (many Christoph has done) and we should be consistent IMHO. (There is, of course, no point from a code point of view - I guess you might consider that you are letting people know that we need to endian convert this value in general and that if we change the code in the future it might be needed... but just say no.:) --Tim From owner-xfs@oss.sgi.com Tue Jan 15 20:59:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 21:00:20 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0G4xV2a010711 for ; Tue, 15 Jan 2008 20:59:34 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA26170; Wed, 16 Jan 2008 15:59:49 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0G4xkLF26602708; Wed, 16 Jan 2008 15:59:47 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0G4xhKD26479688; Wed, 16 Jan 2008 15:59:43 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Wed, 16 Jan 2008 15:59:43 +1100 From: David Chinner To: Timothy Shimmin Cc: Barry Naujok , Chandan Talukdar , "xfs@oss.sgi.com" Subject: Re: [REVIEW] Refactor xfs_repair's process_dinode_int Message-ID: <20080116045943.GU155407@sgi.com> References: <4782B72D.8070208@agami.com> <47833C0F.6070206@agami.com> <478D1899.9080201@agami.com> <478D75C2.5010004@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <478D75C2.5010004@sgi.com> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5484/Tue Jan 15 11:31:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14142 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Wed, Jan 16, 2008 at 02:10:58PM +1100, Timothy Shimmin wrote: > Not that it is a big deal....but my 2 cents... > > Barry Naujok wrote: > >On Wed, 16 Jan 2008 07:33:29 +1100, Chandan Talukdar > >wrote: > > > >>Hi Barry, > >> > >>- In process_misc_ino_types(), dino->di_core.di_size is being accessed > >>without being converted to machine format. The check is being > >>performed against 0; so, it should be fine. But for better code > >>readability, I guess it should be accessed through be64_to_cpu(). > > > >Yeah... sort of in two-minds about this one. > > > Well, traditionally we would not be endian converting it. > We don't endian convert things which are compared to zero or > are only 1 byte. There are a bunch of examples in the kernel > code (many Christoph has done) and we should be consistent IMHO. > > (There is, of course, no point from a code point of view - Exactly. As a result the kernel does not have endian types for single byte variables (ie. there's __be16, __be32, __be64 but not __be8), nor are there cpu_to_be8 or be8_to_cpu conversion functions. Hence the lack of them in the XFS code ;) > I guess you might consider that you are letting people know > that we need to endian convert this value in general and > that if we change the code in the future it might be needed... Well, that should be obvious when changing the structure that has lots of __beX types in already.... > but just say no.:) Agreed ;) Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Tue Jan 15 22:32:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 22:33:05 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0G6WuMq016898 for ; Tue, 15 Jan 2008 22:32:59 -0800 X-ASG-Debug-ID: 1200465191-52dd00650000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from pentafluge.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B7468524A27 for ; Tue, 15 Jan 2008 22:33:11 -0800 (PST) Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by cuda.sgi.com with ESMTP id c5MBFsBxIXx9a3tI for ; Tue, 15 Jan 2008 22:33:11 -0800 (PST) Received: from hch by pentafluge.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1JF1pD-0005Yo-4w; Wed, 16 Jan 2008 06:32:35 +0000 Date: Wed, 16 Jan 2008 06:32:35 +0000 From: Christoph Hellwig To: David Chinner Cc: Timothy Shimmin , Barry Naujok , Chandan Talukdar , "xfs@oss.sgi.com" X-ASG-Orig-Subj: Re: [REVIEW] Refactor xfs_repair's process_dinode_int Subject: Re: [REVIEW] Refactor xfs_repair's process_dinode_int Message-ID: <20080116063234.GA21317@infradead.org> References: <4782B72D.8070208@agami.com> <47833C0F.6070206@agami.com> <478D1899.9080201@agami.com> <478D75C2.5010004@sgi.com> <20080116045943.GU155407@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080116045943.GU155407@sgi.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: pentafluge.infradead.org[213.146.154.40] X-Barracuda-Start-Time: 1200465194 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39656 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5484/Tue Jan 15 11:31:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14143 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Wed, Jan 16, 2008 at 03:59:43PM +1100, David Chinner wrote: > As a result the kernel does not have endian types for single > byte variables (ie. there's __be16, __be32, __be64 but not __be8), > nor are there cpu_to_be8 or be8_to_cpu conversion functions. > Hence the lack of them in the XFS code ;) > > > I guess you might consider that you are letting people know > > that we need to endian convert this value in general and > > that if we change the code in the future it might be needed... > > Well, that should be obvious when changing the structure > that has lots of __beX types in already.... Actually enabling sparse checking for endianess annotations is still on my todo list. I started this project a while ago but failed when the cgcc wrapper had some problems interacting with libtool. I'll see how to get that resolved. From owner-xfs@oss.sgi.com Tue Jan 15 22:43:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 22:43:47 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0G6hc0d017906 for ; Tue, 15 Jan 2008 22:43:42 -0800 X-ASG-Debug-ID: 1200465836-52dd007c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wa-out-1112.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 368E8524DC0 for ; Tue, 15 Jan 2008 22:43:57 -0800 (PST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.177]) by cuda.sgi.com with ESMTP id sfJ81nCx7R4icHm5 for ; Tue, 15 Jan 2008 22:43:57 -0800 (PST) Received: by wa-out-1112.google.com with SMTP id k22so256234waf.18 for ; Tue, 15 Jan 2008 22:43:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=2t3n6AQTQ+6Qcr+tj0+oiJOE5/nHBbKZP1p31BQ3Pvc=; b=uvk4sAhE+3ZlS875fjDPzpLLe78CjjQtG7RIDglUIewetJ4wWbizEFx/8onJZlNMuBK4t5gTNW+cxT1eVGCY0u4yF2r4NL4CYGc5GMbX1ToaUpmDKIgy+6ITOihtU6zYwPNzhwXF4LicKuehYU44eYhsznm4riKnz/a2DSzrIhU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=RyHob+mqyaBcoZ4xsBNgRvDfMymfTT30xEZ0gOocnObQqWYeBSffW32/qE2uDprGqXHDWrfVYfbkWNekJEWI2s/m/x3wkm9V+t/aL+g5apomR1o4kMAG/s4czqm3WnE7XIFEr1Ku+jJJbun6TMmH/O2s9auItKz3B4l18lSi5xc= Received: by 10.114.12.9 with SMTP id 9mr525560wal.23.1200465834032; Tue, 15 Jan 2008 22:43:54 -0800 (PST) Received: by 10.114.182.4 with HTTP; Tue, 15 Jan 2008 22:43:54 -0800 (PST) Message-ID: Date: Wed, 16 Jan 2008 12:13:54 +0530 From: "Gopala Krishna" To: nscott@aconex.com X-ASG-Orig-Subj: Re: Question related to XFS sync , especially fsync Subject: Re: Question related to XFS sync , especially fsync Cc: xfs@oss.sgi.com In-Reply-To: <1200436012.9463.184.camel@edge.scott.net.au> MIME-Version: 1.0 References: <20080114224245.GT155259@sgi.com> <478CCEAC.9010008@sandeen.net> <1200436012.9463.184.camel@edge.scott.net.au> X-Barracuda-Connect: wa-out-1112.google.com[209.85.146.177] X-Barracuda-Start-Time: 1200465837 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39656 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/5484/Tue Jan 15 11:31:27 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 1223 X-archive-position: 14144 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: gopalakrishna.n.m@gmail.com Precedence: bulk X-list: xfs Is there any XFS call from user level to flush metadata for a given file or complete log to disk? Thanks, Gopal. On 1/16/08, Nathan Scott wrote: > > On Tue, 2008-01-15 at 09:18 -0600, Eric Sandeen wrote: > > > > > I have lot of code getting in to that. To explain that I have to go > > through > > > that complex part of the code to explain in detail. > > > > > > Basically once we get indoe number for a given file from the > > available > > > system call, we only depending upon the XFS layout and it's > > structure. We > > > are reading super block from a particular disk offset and > > calculating > > > address for inode offset and its address on the disk and reading > > directly > > > from the disk offset. We are totally depending on XFS on disk > > layout. > > > > Can I ask why you are doing this? :) > > > > This would be good to know. If you absolutely must use inode numbers > instead of path names, you should use the "by-handle" interface (like > xfsdump, xfs_fsr, etc) and not use the ondisk structures directly - > doing so is always "broken by design" and you'll get little sympathy > here for doing so. :) > > cheers. > > -- > Nathan > > [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Tue Jan 15 23:25:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 23:25:07 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=5.0 tests=AWL,BAYES_20,HTML_MESSAGE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0G7P008020986 for ; Tue, 15 Jan 2008 23:25:04 -0800 X-ASG-Debug-ID: 1200468318-76a400860000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wa-out-1112.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 83E44C5678D for ; Tue, 15 Jan 2008 23:25:18 -0800 (PST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.177]) by cuda.sgi.com with ESMTP id R2c0oTmlMZZEADmt for ; Tue, 15 Jan 2008 23:25:18 -0800 (PST) Received: by wa-out-1112.google.com with SMTP id k22so276931waf.18 for ; Tue, 15 Jan 2008 23:25:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=JWuwTZzb5K2nZ0yPXxUwQ4Etx3ybq0XK2sGXJ4TUf4Q=; b=WQhmtrH7TDMKeYQBPsttByKOgIkPofuMWyLe8UnkhWOjhb/ZJZOzAEXY5oE08p9+ypW1+Zl6j8ObjnlaP9YZDZmldKEdnjJQBICI8giaiWnDepMCnxaxT6Upt43fZPk6BZ8bLtdehUP65YU5klZNATqKm2vwd9CE2zL5ig0gXyA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=UQLy/70s4O/xFo7EcvLyCnRD+P3qHV6u4ui+Z6Ro4Ob2oGY5bzJ/lOnj+43yHb4g0LDykw2dVKhw9yG8Ld302w++EYLQX61kD/Decf+pVscC/D1aSUPFSDz1FjJrV1dTRyNbWyj9mRh9ZTGK8i2sDzUDJAJbSyVNV98LCbm1RS4= Received: by 10.115.74.1 with SMTP id b1mr536309wal.93.1200468317697; Tue, 15 Jan 2008 23:25:17 -0800 (PST) Received: by 10.114.182.4 with HTTP; Tue, 15 Jan 2008 23:25:17 -0800 (PST) Message-ID: Date: Wed, 16 Jan 2008 12:55:17 +0530 From: "Gopala Krishna" To: "Chris Wedgwood" X-ASG-Orig-Subj: Re: Question related to XFS sync , especially fsync Subject: Re: Question related to XFS sync , especially fsync Cc: nscott@aconex.com, xfs@oss.sgi.com In-Reply-To: <20080116064840.GA5725@puku.stupidest.org> MIME-Version: 1.0 References: <20080114224245.GT155259@sgi.com> <478CCEAC.9010008@sandeen.net> <1200436012.9463.184.camel@edge.scott.net.au> <20080116064840.GA5725@puku.stupidest.org> X-Barracuda-Connect: wa-out-1112.google.com[209.85.146.177] X-Barracuda-Start-Time: 1200468318 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39657 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/5484/Tue Jan 15 11:31:27 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 1430 X-archive-position: 14145 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: gopalakrishna.n.m@gmail.com Precedence: bulk X-list: xfs Thank you Chris. While replying to Eric, I mentioned why we are doing that. We are basically providing interfaces to back up applications in a pure storage environment that deals with the back up at block level (sector level) and hence depending upon different file system, we need to get information about file like it's extent information and associated block numbers etc. To extract these there is no system call and hence we are depending on disk layout published by file system vendors and the header file provided by them. If there is a user level system call to deal with the extent information etc, we can use , but many file system is not providing that. Basically if we give file it should eb in aposition to display metadata informations including extents and corresponding logical block numbers and device offsets. I have to do it programitically and hence if I have some system call rather than command, that would be helpful. Freeze/unfreeze is a command it seems right? Thanks, Gopal. On 1/16/08, Chris Wedgwood wrote: > > On Wed, Jan 16, 2008 at 12:13:54PM +0530, Gopala Krishna wrote: > > > Is there any XFS call from user level to flush metadata for a given > > file or complete log to disk? > > like a said earlier, try freeze/unfreeze > > you've not explained what you're doing (well, why you're doing it) > > it sounds very problematic by design > [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Tue Jan 15 23:52:05 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jan 2008 23:52:11 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0G7q2fX022717 for ; Tue, 15 Jan 2008 23:52:05 -0800 X-ASG-Debug-ID: 1200469939-14c502af0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from fg-out-1718.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C9C2E525121 for ; Tue, 15 Jan 2008 23:52:20 -0800 (PST) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.154]) by cuda.sgi.com with ESMTP id DBXJw2NW3vNOECgi for ; Tue, 15 Jan 2008 23:52:20 -0800 (PST) Received: by fg-out-1718.google.com with SMTP id e12so197659fga.8 for ; Tue, 15 Jan 2008 23:52:19 -0800 (PST) Received: by 10.86.60.15 with SMTP id i15mr455774fga.28.1200469938886; Tue, 15 Jan 2008 23:52:18 -0800 (PST) Received: from teal.hq.k1024.org ( [84.75.117.152]) by mx.google.com with ESMTPS id y6sm1418411mug.1.2008.01.15.23.52.17 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 15 Jan 2008 23:52:17 -0800 (PST) Received: by teal.hq.k1024.org (Postfix, from userid 4004) id 859F540A556; Wed, 16 Jan 2008 08:52:15 +0100 (CET) Date: Wed, 16 Jan 2008 08:52:15 +0100 From: Iustin Pop To: Gopala Krishna Cc: Chris Wedgwood , nscott@aconex.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Question related to XFS sync , especially fsync Subject: Re: Question related to XFS sync , especially fsync Message-ID: <20080116075215.GA26822@teal.hq.k1024.org> Mail-Followup-To: Gopala Krishna , Chris Wedgwood , nscott@aconex.com, xfs@oss.sgi.com References: <20080114224245.GT155259@sgi.com> <478CCEAC.9010008@sandeen.net> <1200436012.9463.184.camel@edge.scott.net.au> <20080116064840.GA5725@puku.stupidest.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Linux: This message was written on Linux X-Header: /usr/include gives great headers User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: fg-out-1718.google.com[72.14.220.154] X-Barracuda-Start-Time: 1200469940 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39657 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5484/Tue Jan 15 11:31:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14146 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: iusty@k1024.org Precedence: bulk X-list: xfs On Wed, Jan 16, 2008 at 12:55:17PM +0530, Gopala Krishna wrote: > If there is a user level system call to deal with the extent information > etc, we can use , but many file system is not providing that. Basically if > we give file it should eb in aposition to display metadata informations > including extents and corresponding logical block numbers and device > offsets. > > I have to do it programitically and hence if I have some system call rather > than command, that would be helpful. Freeze/unfreeze is a command it seems > right? Well, most commands are backed by a system call, right? For example, strace xfs_freeze to see what system calls it does. IIRC, only xfs_db has to access the raw device. For the block mapping, look at xfs_bmap (and its backend xfs_io), which should do exactly what you want. iustin From owner-xfs@oss.sgi.com Wed Jan 16 00:17:14 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jan 2008 00:17:18 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0G8HCAf026546 for ; Wed, 16 Jan 2008 00:17:14 -0800 X-ASG-Debug-ID: 1200471450-52dc01160000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wa-out-1112.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B42AB525284 for ; Wed, 16 Jan 2008 00:17:30 -0800 (PST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by cuda.sgi.com with ESMTP id npJGVCXUbE0Q2EGm for ; Wed, 16 Jan 2008 00:17:30 -0800 (PST) Received: by wa-out-1112.google.com with SMTP id k22so304225waf.18 for ; Wed, 16 Jan 2008 00:17:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; bh=CpCxPuucXBNQVov6eSWTFwx/YXH+8X7xYVVQ7vvIuAc=; b=MJEFxVfK1DoMTN385nNlELkRKetSucTK8Or9Lvow5f8ZaB/VF/OO3dptHsnuQw+EGfSQCEdcN24GpgIH3QmK+K5QBUfWgdic3r5lo37bMd6BPRBtCB+q+BdO9vz3vyRXLzvAUcOTntC2LAK2TT0WZ95f93aATI/vtDxtL9sRpKk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=sQWw9lXWwnjce95Zd8onLvduPzdPMSGLCx1kafsUHu/Xhot2Cikae/ulWoboUUQq8v8yjo2GTyMtwAKsyhi9xbHh4PDax4nBTYnnsFXtYOqvYzwYwm+/iY6ZZWpDHKi3mAw63IDaszCpFaBdnoWUFmhVD0Z1xd8OJnqZCRKoiMI= Received: by 10.114.123.1 with SMTP id v1mr560256wac.147.1200471077897; Wed, 16 Jan 2008 00:11:17 -0800 (PST) Received: by 10.114.182.4 with HTTP; Wed, 16 Jan 2008 00:11:17 -0800 (PST) Message-ID: Date: Wed, 16 Jan 2008 13:41:17 +0530 From: "Gopala Krishna" To: "Gopala Krishna" , "Chris Wedgwood" , nscott@aconex.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Question related to XFS sync , especially fsync Subject: Re: Question related to XFS sync , especially fsync In-Reply-To: <20080116075215.GA26822@teal.hq.k1024.org> MIME-Version: 1.0 References: <20080114224245.GT155259@sgi.com> <478CCEAC.9010008@sandeen.net> <1200436012.9463.184.camel@edge.scott.net.au> <20080116064840.GA5725@puku.stupidest.org> <20080116075215.GA26822@teal.hq.k1024.org> X-Barracuda-Connect: wa-out-1112.google.com[209.85.146.178] X-Barracuda-Start-Time: 1200471450 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39657 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/5484/Tue Jan 15 11:31:27 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 1058 X-archive-position: 14147 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: gopalakrishna.n.m@gmail.com Precedence: bulk X-list: xfs You are right and that is the approach I will follow if there is no direct system call. Thanks, Gopal. On 1/16/08, Iustin Pop wrote: > > On Wed, Jan 16, 2008 at 12:55:17PM +0530, Gopala Krishna wrote: > > If there is a user level system call to deal with the extent information > > etc, we can use , but many file system is not providing that. Basically > if > > we give file it should eb in aposition to display metadata informations > > including extents and corresponding logical block numbers and device > > offsets. > > > > I have to do it programitically and hence if I have some system call > rather > > than command, that would be helpful. Freeze/unfreeze is a command it > seems > > right? > > Well, most commands are backed by a system call, right? For example, > strace xfs_freeze to see what system calls it does. IIRC, only xfs_db > has to access the raw device. > > For the block mapping, look at xfs_bmap (and its backend xfs_io), which > should do exactly what you want. > > iustin > [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Wed Jan 16 00:25:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jan 2008 00:25:34 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0G8PM17031416 for ; Wed, 16 Jan 2008 00:25:23 -0800 X-ASG-Debug-ID: 1200471940-78e000df0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from pentafluge.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 719CF525318 for ; Wed, 16 Jan 2008 00:25:40 -0800 (PST) Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by cuda.sgi.com with ESMTP id DHQZb2AbvRHIFGna for ; Wed, 16 Jan 2008 00:25:40 -0800 (PST) Received: from hch by pentafluge.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1JF3a2-0006Jv-Vj; Wed, 16 Jan 2008 08:25:03 +0000 Date: Wed, 16 Jan 2008 08:25:02 +0000 From: Christoph Hellwig To: Gopala Krishna Cc: Chris Wedgwood , nscott@aconex.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Question related to XFS sync , especially fsync Subject: Re: Question related to XFS sync , especially fsync Message-ID: <20080116082502.GA24175@infradead.org> References: <20080114224245.GT155259@sgi.com> <478CCEAC.9010008@sandeen.net> <1200436012.9463.184.camel@edge.scott.net.au> <20080116064840.GA5725@puku.stupidest.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: pentafluge.infradead.org[213.146.154.40] X-Barracuda-Start-Time: 1200471941 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39657 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5484/Tue Jan 15 11:31:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14148 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Wed, Jan 16, 2008 at 12:55:17PM +0530, Gopala Krishna wrote: > While replying to Eric, I mentioned why we are doing that. We are > basically providing interfaces to back up applications in a pure storage > environment that deals with the back up at block level (sector level) and > hence depending upon different file system, we need to get information about > file like it's extent information and associated block numbers etc. This basically can't work. If you do a plain block based backup you need to freeze the filesystem first and then either backup through a newly created snapshot or the raw device. Alternatively you can do file-based backups assisted by the bulkstat interface as done by xfsdump. If you try to mix the two layers you get into deep trouble due to various issues: - knowledge of the disk format. The ondisk format can change anytime and will break your application. And yes, additions to the ondisk format do happen quite frequently. - no coherency between the filesystem and the block device node. This is especially true for backup applications which use the buffered block device nodes because there is a real-life chance that stale cache is around - no guarantee that the ondisk image is actually update. XFS like most other current filesystems uses an intent log to provide reliabily and sync is only guaranteed to push updates into the log but not actually write it back to it's "normal" location on disk. In short what you're trying to do is a road to disaster, so don't do it! Note that the problems apply to any filesystem in one way or another, not just XFS. From owner-xfs@oss.sgi.com Wed Jan 16 01:00:05 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jan 2008 01:00:09 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0G900dO001159 for ; Wed, 16 Jan 2008 01:00:04 -0800 X-ASG-Debug-ID: 1200474015-53b401e70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wa-out-1112.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 359A7C569E8 for ; Wed, 16 Jan 2008 01:00:15 -0800 (PST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.178]) by cuda.sgi.com with ESMTP id aSZ0cEnhPAFml6Z6 for ; Wed, 16 Jan 2008 01:00:15 -0800 (PST) Received: by wa-out-1112.google.com with SMTP id k22so327787waf.18 for ; Wed, 16 Jan 2008 01:00:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=q4/XuHgR6btpig686N/WD+ql5Hi/FGHyaR3hUUfmo/s=; b=TzWcBo58L8SmKA6hXi7wOaqALZ1uRr1/LhdsbLEFdmP3eIR9KcGqDXCUnIgE2K9JyQzv1uBhQE2BorzHy9RDq9tG7/KK/yqwFHUnmiovsD4YL44VBTMZECgAqY2HY6KAR1SgQ51leo8O3Jn8BJBfE8UnJNoOlOwX5VS9xOEDRAs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=FNtH0qVGg/5WNncDqDyIXu+Sh8vRIGnc5iGTfNAKpcLM8dt9bhGLJjomls5FT+VlP6vKYgBd3gko/dBq5pEyBx4TcXbpVR2L7AILK8a/Fez3HZeo+3hdFsc+Ow3lM7SBm3xMvFM8odkly8gRZeYpjuGAae7MNDo1+BNcMc6T/8c= Received: by 10.114.110.12 with SMTP id i12mr636229wac.73.1200474014809; Wed, 16 Jan 2008 01:00:14 -0800 (PST) Received: by 10.114.182.4 with HTTP; Wed, 16 Jan 2008 01:00:14 -0800 (PST) Message-ID: Date: Wed, 16 Jan 2008 14:30:14 +0530 From: "Gopala Krishna" To: "Christoph Hellwig" X-ASG-Orig-Subj: Re: Question related to XFS sync , especially fsync Subject: Re: Question related to XFS sync , especially fsync Cc: "Chris Wedgwood" , nscott@aconex.com, xfs@oss.sgi.com In-Reply-To: <20080116082502.GA24175@infradead.org> MIME-Version: 1.0 References: <20080114224245.GT155259@sgi.com> <478CCEAC.9010008@sandeen.net> <1200436012.9463.184.camel@edge.scott.net.au> <20080116064840.GA5725@puku.stupidest.org> <20080116082502.GA24175@infradead.org> X-Barracuda-Connect: wa-out-1112.google.com[209.85.146.178] X-Barracuda-Start-Time: 1200474018 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/5484/Tue Jan 15 11:31:27 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 1947 X-archive-position: 14149 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: gopalakrishna.n.m@gmail.com Precedence: bulk X-list: xfs Thanks for the suggestions!. I will relook at the my idea and design....implemetation. As of now what we are doing is in experimental stage. Thanks, Gopal. On 1/16/08, Christoph Hellwig wrote: > > On Wed, Jan 16, 2008 at 12:55:17PM +0530, Gopala Krishna wrote: > > While replying to Eric, I mentioned why we are doing that. We are > > basically providing interfaces to back up applications in a pure storage > > environment that deals with the back up at block level (sector level) > and > > hence depending upon different file system, we need to get information > about > > file like it's extent information and associated block numbers etc. > > This basically can't work. If you do a plain block based backup you > need to freeze the filesystem first and then either backup through a > newly created snapshot or the raw device. Alternatively you can do > file-based backups assisted by the bulkstat interface as done by > xfsdump. If you try to mix the two layers you get into deep trouble > due to various issues: > > - knowledge of the disk format. The ondisk format can change anytime > and will break your application. And yes, additions to the ondisk > format do happen quite frequently. > - no coherency between the filesystem and the block device node. This > is especially true for backup applications which use the buffered > block device nodes because there is a real-life chance that stale > cache is around > - no guarantee that the ondisk image is actually update. XFS like > most other current filesystems uses an intent log to provide > reliabily and sync is only guaranteed to push updates into the log > but not actually write it back to it's "normal" location on disk. > > In short what you're trying to do is a road to disaster, so don't do it! > > Note that the problems apply to any filesystem in one way or another, > not just XFS. > > [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Wed Jan 16 03:52:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jan 2008 03:52:25 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0GBqDm9013510 for ; Wed, 16 Jan 2008 03:52:17 -0800 Received: from [134.15.251.7] (melb-sw-corp-251-7.corp.sgi.com [134.15.251.7]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id WAA08131; Wed, 16 Jan 2008 22:52:19 +1100 Message-ID: <478DEFF0.40004@sgi.com> Date: Wed, 16 Jan 2008 22:52:16 +1100 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 1.5.0.14 (Windows/20071210) MIME-Version: 1.0 To: Gopala Krishna CC: Christoph Hellwig , Chris Wedgwood , nscott@aconex.com, xfs@oss.sgi.com Subject: Re: Question related to XFS sync , especially fsync References: <20080114224245.GT155259@sgi.com> <478CCEAC.9010008@sandeen.net> <1200436012.9463.184.camel@edge.scott.net.au> <20080116064840.GA5725@puku.stupidest.org> <20080116082502.GA24175@infradead.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/5484/Tue Jan 15 11:31:27 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14150 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Gopala, it sounds like you want something like NDMP. Check that out first. -- Mark Gopala Krishna wrote: > Thanks for the suggestions!. I will relook at the my idea and > design....implemetation. As of now what we are doing is in experimental > stage. > > Thanks, > Gopal. > > > On 1/16/08, Christoph Hellwig wrote: >> On Wed, Jan 16, 2008 at 12:55:17PM +0530, Gopala Krishna wrote: >>> While replying to Eric, I mentioned why we are doing that. We are >>> basically providing interfaces to back up applications in a pure storage >>> environment that deals with the back up at block level (sector level) >> and >>> hence depending upon different file system, we need to get information >> about >>> file like it's extent information and associated block numbers etc. >> This basically can't work. If you do a plain block based backup you >> need to freeze the filesystem first and then either backup through a >> newly created snapshot or the raw device. Alternatively you can do >> file-based backups assisted by the bulkstat interface as done by >> xfsdump. If you try to mix the two layers you get into deep trouble >> due to various issues: >> >> - knowledge of the disk format. The ondisk format can change anytime >> and will break your application. And yes, additions to the ondisk >> format do happen quite frequently. >> - no coherency between the filesystem and the block device node. This >> is especially true for backup applications which use the buffered >> block device nodes because there is a real-life chance that stale >> cache is around >> - no guarantee that the ondisk image is actually update. XFS like >> most other current filesystems uses an intent log to provide >> reliabily and sync is only guaranteed to push updates into the log >> but not actually write it back to it's "normal" location on disk. >> >> In short what you're trying to do is a road to disaster, so don't do it! >> >> Note that the problems apply to any filesystem in one way or another, >> not just XFS. >> >> > > > [[HTML alternate version deleted]] > > -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Wed Jan 16 10:02:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jan 2008 10:02:55 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_56 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0GI2MV0013197 for ; Wed, 16 Jan 2008 10:02:24 -0800 X-ASG-Debug-ID: 1200506560-5a18005d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 67551527FDC for ; Wed, 16 Jan 2008 10:02:41 -0800 (PST) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id lM5DCpYN5q3XyOtq for ; Wed, 16 Jan 2008 10:02:41 -0800 (PST) Received: by lucidpixels.com (Postfix, from userid 1001) id 5C33C1C000266; Wed, 16 Jan 2008 13:02:40 -0500 (EST) Date: Wed, 16 Jan 2008 13:02:40 -0500 (EST) From: Justin Piszcz X-X-Sender: jpiszcz@p34.internal.lan To: Al Boldi cc: xfs@oss.sgi.com, linux-raid@vger.kernel.org, Alan Piszcz X-ASG-Orig-Subj: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again Subject: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again In-Reply-To: <200801162027.00791.a1426z@gawab.com> Message-ID: References: <200801162027.00791.a1426z@gawab.com> User-Agent: Alpine 0.999999 (DEB 847 2007-12-06) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1200506561 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39680 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5485/Wed Jan 16 05:06:29 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14151 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Wed, 16 Jan 2008, Al Boldi wrote: > Justin Piszcz wrote: >> For these benchmarks I timed how long it takes to extract a standard 4.4 >> GiB DVD: >> >> Settings: Software RAID 5 with the following settings (until I change >> those too): >> >> Base setup: >> blockdev --setra 65536 /dev/md3 >> echo 16384 > /sys/block/md3/md/stripe_cache_size >> echo "Disabling NCQ on all disks..." >> for i in $DISKS >> do >> echo "Disabling NCQ on $i" >> echo 1 > /sys/block/"$i"/device/queue_depth >> done >> >> p34:~# grep : *chunk* |sort -n >> 4-chunk.txt:0:45.31 >> 8-chunk.txt:0:44.32 >> 16-chunk.txt:0:41.02 >> 32-chunk.txt:0:40.50 >> 64-chunk.txt:0:40.88 >> 128-chunk.txt:0:40.21 >> 256-chunk.txt:0:40.14*** >> 512-chunk.txt:0:40.35 >> 1024-chunk.txt:0:41.11 >> 2048-chunk.txt:0:43.89 >> 4096-chunk.txt:0:47.34 >> 8192-chunk.txt:0:57.86 >> 16384-chunk.txt:1:09.39 >> 32768-chunk.txt:1:26.61 >> >> It would appear a 256 KiB chunk-size is optimal. > > Can you retest with different max_sectors_kb on both md and sd? Remember this is SW RAID, so max_sectors_kb will only affect the individual disks underneath the SW RAID, I have benchmarked in the past, the defaults chosen by the kernel are optimal, changing them did not make any noticable improvements. > > Also, can you retest using dd with different block-sizes? I can do this, moment.. I know about oflag=direct but I choose to use dd with sync and measure the total time it takes. /usr/bin/time -f %E -o ~/$i=chunk.txt bash -c 'dd if=/dev/zero of=/r1/bigfile bs=1M count=10240; sync' So I was asked on the mailing list to test dd with various chunk sizes, here is the length of time it took to write 10 GiB and sync per each chunk size: 4=chunk.txt:0:25.46 8=chunk.txt:0:25.63 16=chunk.txt:0:25.26 32=chunk.txt:0:25.08 64=chunk.txt:0:25.55 128=chunk.txt:0:25.26 256=chunk.txt:0:24.72 512=chunk.txt:0:24.71 1024=chunk.txt:0:25.40 2048=chunk.txt:0:25.71 4096=chunk.txt:0:27.18 8192=chunk.txt:0:29.00 16384=chunk.txt:0:31.43 32768=chunk.txt:0:50.11 65536=chunk.txt:2:20.80 Justin. From owner-xfs@oss.sgi.com Wed Jan 16 10:19:40 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jan 2008 10:19:42 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0GIJcKx014629 for ; Wed, 16 Jan 2008 10:19:40 -0800 X-ASG-Debug-ID: 1200507593-17c100970000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 26922C6078E for ; Wed, 16 Jan 2008 10:19:53 -0800 (PST) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id lHZfwhw5gl5jMXPR for ; Wed, 16 Jan 2008 10:19:53 -0800 (PST) Received: by lucidpixels.com (Postfix, from userid 1001) id 6B9DF1C000266; Wed, 16 Jan 2008 13:19:53 -0500 (EST) Date: Wed, 16 Jan 2008 13:19:53 -0500 (EST) From: Justin Piszcz X-X-Sender: jpiszcz@p34.internal.lan To: Greg Cormier cc: xfs@oss.sgi.com, linux-raid@vger.kernel.org, Alan Piszcz X-ASG-Orig-Subj: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again Subject: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again In-Reply-To: <29a863790801161009h7bb1f0f7v34bc893fce338567@mail.gmail.com> Message-ID: References: <29a863790801161009h7bb1f0f7v34bc893fce338567@mail.gmail.com> User-Agent: Alpine 0.999999 (DEB 847 2007-12-06) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1200507597 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39681 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5485/Wed Jan 16 05:06:29 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14152 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Wed, 16 Jan 2008, Greg Cormier wrote: > What sort of tools are you using to get these benchmarks, and can I > used them for ext3? > > Very interested in running this on my server. > > > Thanks, > Greg > You can use whatever suits you, such as untar kernel source tree, copy files, untar backups, etc--, you should benchmark specifically what *your* workload is. Here is the skeleton, using bash:: (don't forget to turn off the cron daemon) for i in 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 do cd / umount /r1 mdadm -S /dev/md3 mdadm --create --assume-clean --verbose /dev/md3 --level=5 --raid-devices=10 --chunk=$i --run /dev/sd[c-l]1 /etc/init.d/oraid.sh # to optimize my raid stuff mkfs.xfs -f /dev/md3 mount /dev/md3 /r1 -o logbufs=8,logbsize=262144 # then simply add what you do often here # everyone's workload is different /usr/bin/time -f %E -o ~/$i=chunk.txt bash -c 'dd if=/dev/zero of=/r1/bigfile bs=1M count=10240; sync' done Then just, grep : /root/*chunk* | sort -n to get the results in the same format. Justin. From owner-xfs@oss.sgi.com Wed Jan 16 13:17:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jan 2008 13:17:38 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0GLHObJ002364 for ; Wed, 16 Jan 2008 13:17:25 -0800 X-ASG-Debug-ID: 1200518259-014300400000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.lichtvoll.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 80ACBC676DB for ; Wed, 16 Jan 2008 13:17:39 -0800 (PST) Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by cuda.sgi.com with ESMTP id IAiUlFGtcokag4Mu for ; Wed, 16 Jan 2008 13:17:39 -0800 (PST) Received: from [192.168.1.21] (dslb-084-057-098-078.pools.arcor-ip.net [84.57.98.78]) by mail.lichtvoll.de (Postfix) with ESMTP id DDDB85AE2F; Wed, 16 Jan 2008 22:16:52 +0100 (CET) From: Martin Steigerwald To: markgw@sgi.com X-ASG-Orig-Subj: Re: Question related to XFS sync , especially fsync Subject: Re: Question related to XFS sync , especially fsync Date: Wed, 16 Jan 2008 22:17:34 +0100 User-Agent: KMail/1.9.7 Cc: Gopala Krishna , Christoph Hellwig , Chris Wedgwood , nscott@aconex.com, xfs@oss.sgi.com References: <478DEFF0.40004@sgi.com> (sfid-20080116_130938_790120_481702E4) In-Reply-To: <478DEFF0.40004@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801162217.35594.Martin@lichtvoll.de> X-Barracuda-Connect: mondschein.lichtvoll.de[194.150.191.11] X-Barracuda-Start-Time: 1200518262 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39693 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5488/Wed Jan 16 12:44:30 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14153 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Martin@lichtvoll.de Precedence: bulk X-list: xfs Am Mittwoch 16 Januar 2008 schrieb Mark Goodwin: > Gopala, > > it sounds like you want something like NDMP. Check that out first. Is there an open source implementation available for this protocol? Would be interesting to know. -- Martin 'Helios' Steigerwald - http://www.Lichtvoll.de GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7 From owner-xfs@oss.sgi.com Wed Jan 16 14:52:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jan 2008 14:52:53 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_56 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0GMqn1E008804 for ; Wed, 16 Jan 2008 14:52:50 -0800 X-ASG-Debug-ID: 1200523985-62f700d30000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 03D42529F50 for ; Wed, 16 Jan 2008 14:53:06 -0800 (PST) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id FzQkZ4MGPnnZ7nDE for ; Wed, 16 Jan 2008 14:53:06 -0800 (PST) Received: by lucidpixels.com (Postfix, from userid 1001) id 4DA511C00022E; Wed, 16 Jan 2008 17:53:05 -0500 (EST) Date: Wed, 16 Jan 2008 17:53:05 -0500 (EST) From: Justin Piszcz X-X-Sender: jpiszcz@p34.internal.lan To: Al Boldi cc: xfs@oss.sgi.com, linux-raid@vger.kernel.org, Alan Piszcz X-ASG-Orig-Subj: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again Subject: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again In-Reply-To: <200801170019.04836.a1426z@gawab.com> Message-ID: References: <200801162027.00791.a1426z@gawab.com> <200801170019.04836.a1426z@gawab.com> User-Agent: Alpine 0.999999 (DEB 847 2007-12-06) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1200523988 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39696 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5488/Wed Jan 16 12:44:30 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14154 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Thu, 17 Jan 2008, Al Boldi wrote: > Justin Piszcz wrote: >> On Wed, 16 Jan 2008, Al Boldi wrote: >>>> Also, can you retest using dd with different block-sizes? >> >> I can do this, moment.. >> >> >> I know about oflag=direct but I choose to use dd with sync and measure the >> total time it takes. >> /usr/bin/time -f %E -o ~/$i=chunk.txt bash -c 'dd if=/dev/zero >> of=/r1/bigfile bs=1M count=10240; sync' >> >> So I was asked on the mailing list to test dd with various chunk sizes, >> here is the length of time it took >> to write 10 GiB and sync per each chunk size: >> >> 4=chunk.txt:0:25.46 >> 8=chunk.txt:0:25.63 >> 16=chunk.txt:0:25.26 >> 32=chunk.txt:0:25.08 >> 64=chunk.txt:0:25.55 >> 128=chunk.txt:0:25.26 >> 256=chunk.txt:0:24.72 >> 512=chunk.txt:0:24.71 >> 1024=chunk.txt:0:25.40 >> 2048=chunk.txt:0:25.71 >> 4096=chunk.txt:0:27.18 >> 8192=chunk.txt:0:29.00 >> 16384=chunk.txt:0:31.43 >> 32768=chunk.txt:0:50.11 >> 65536=chunk.txt:2:20.80 > > What do you get with bs=512,1k,2k,4k,8k,16k... > > > Thanks! > > -- > Al > > - > To unsubscribe from this list: send the line "unsubscribe linux-raid" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Done testing for now, but I did test with 256k with a 256k chunk and obviously that got good results, just like 1m with a 1mb chunk, 460-480 MiB/s. Justin. From owner-xfs@oss.sgi.com Wed Jan 16 14:55:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jan 2008 14:55:22 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_56 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0GMtD1x009163 for ; Wed, 16 Jan 2008 14:55:17 -0800 X-ASG-Debug-ID: 1200524131-4c7500930000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 07CD8C68CDB for ; Wed, 16 Jan 2008 14:55:31 -0800 (PST) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id m5CpVxSARcLbn6TD for ; Wed, 16 Jan 2008 14:55:31 -0800 (PST) Received: by lucidpixels.com (Postfix, from userid 1001) id D5FA31C000238; Wed, 16 Jan 2008 17:55:00 -0500 (EST) Date: Wed, 16 Jan 2008 17:55:00 -0500 (EST) From: Justin Piszcz X-X-Sender: jpiszcz@p34.internal.lan To: Al Boldi cc: xfs@oss.sgi.com, linux-raid@vger.kernel.org, Alan Piszcz X-ASG-Orig-Subj: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again Subject: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again In-Reply-To: <200801170019.04836.a1426z@gawab.com> Message-ID: References: <200801162027.00791.a1426z@gawab.com> <200801170019.04836.a1426z@gawab.com> User-Agent: Alpine 0.999999 (DEB 847 2007-12-06) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1200524132 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39697 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5488/Wed Jan 16 12:44:30 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14155 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Thu, 17 Jan 2008, Al Boldi wrote: > Justin Piszcz wrote: >> On Wed, 16 Jan 2008, Al Boldi wrote: >>>> Also, can you retest using dd with different block-sizes? >> >> I can do this, moment.. >> >> >> I know about oflag=direct but I choose to use dd with sync and measure the >> total time it takes. >> /usr/bin/time -f %E -o ~/$i=chunk.txt bash -c 'dd if=/dev/zero >> of=/r1/bigfile bs=1M count=10240; sync' >> >> So I was asked on the mailing list to test dd with various chunk sizes, >> here is the length of time it took >> to write 10 GiB and sync per each chunk size: >> >> 4=chunk.txt:0:25.46 >> 8=chunk.txt:0:25.63 >> 16=chunk.txt:0:25.26 >> 32=chunk.txt:0:25.08 >> 64=chunk.txt:0:25.55 >> 128=chunk.txt:0:25.26 >> 256=chunk.txt:0:24.72 >> 512=chunk.txt:0:24.71 >> 1024=chunk.txt:0:25.40 >> 2048=chunk.txt:0:25.71 >> 4096=chunk.txt:0:27.18 >> 8192=chunk.txt:0:29.00 >> 16384=chunk.txt:0:31.43 >> 32768=chunk.txt:0:50.11 >> 65536=chunk.txt:2:20.80 > > What do you get with bs=512,1k,2k,4k,8k,16k... > > > Thanks! > > -- > Al > > - > To unsubscribe from this list: send the line "unsubscribe linux-raid" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > root 4621 0.0 0.0 12404 760 pts/2 D+ 17:53 0:00 mdadm -S /dev/md3 root 4664 0.0 0.0 4264 728 pts/5 S+ 17:54 0:00 grep D Tried to stop it when it was re-syncing, DEADLOCK :( [ 305.464904] md: md3 still in use. [ 314.595281] md: md_do_sync() got signal ... exiting Anyhow, done testing, time to move data back on if I can kill the resync process w/out deadlock. Justin. From owner-xfs@oss.sgi.com Wed Jan 16 15:24:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jan 2008 15:24:56 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_20 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0GNOlgr011912 for ; Wed, 16 Jan 2008 15:24:49 -0800 X-ASG-Debug-ID: 1200525904-4c7500dc0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.purevideo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7FF72C6920A for ; Wed, 16 Jan 2008 15:25:04 -0800 (PST) Received: from mail.purevideo.com (mail.purevideo.com [208.50.29.149]) by cuda.sgi.com with ESMTP id 4dQgQNU1I11IWCck for ; Wed, 16 Jan 2008 15:25:04 -0800 (PST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-ASG-Orig-Subj: Repairing a possibly incomplete xfs_growfs command? Subject: Repairing a possibly incomplete xfs_growfs command? Date: Wed, 16 Jan 2008 15:19:19 -0800 Message-ID: <9CE70E6ED2C2F64FB5537A2973FA4F0253594C@pvn-3001.purevideo.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Repairing a possibly incomplete xfs_growfs command? Thread-Index: AchYl2UPy/3V5aeGTG6WxLQ5nlhTOA== From: "Mark Magpayo" To: X-Barracuda-Connect: mail.purevideo.com[208.50.29.149] X-Barracuda-Start-Time: 1200525905 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39697 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5488/Wed Jan 16 12:44:30 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m0GNOngr011915 X-archive-position: 14156 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: mmagpayo@purevideo.com Precedence: bulk X-list: xfs Hi, So I have run across a strange situation which I hope there are some gurus out there to help. The original setup was a logical volume of 8.9TB. I extended the volume to 17.7TB and attempted to run xfs_growfs. I am not sure whether the command actually finished, as after I ran the command, the metadata was displayed, but there was no nothing that stated the the number of data blocks had changed. I was just returned to the prompt, so I'm not sure whether the command completed or not.. I was unable write to the logical volume I had just created. I tried to remount it, but I kept getting an error saying the superblock could not be read. I tried running an xfs_repair on the filesystem, and get the following: Phase 1 - find and verify superblock... superblock read failed, offset 19504058859520, size 2048, ag 64, rval 0 fatal error -- Invalid argument I am not very experienced with xfs (I was following commands in some documentaion), and I was recommended to post to this mailing list. If anyone could provide some help, it would be greatly appreciate. Also, if there is any information I can provide to help, I will gladly provide it. Thanks in advance! Sincerely, Mark From owner-xfs@oss.sgi.com Wed Jan 16 15:38:09 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jan 2008 15:38:14 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0GNc3Vo013047 for ; Wed, 16 Jan 2008 15:38:07 -0800 Received: from [134.14.55.21] (dhcp21.melbourne.sgi.com [134.14.55.21]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id KAA26943; Thu, 17 Jan 2008 10:38:10 +1100 Message-ID: <478E955F.9080607@sgi.com> Date: Thu, 17 Jan 2008 10:38:07 +1100 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 1.5.0.14 (Windows/20071210) MIME-Version: 1.0 To: Martin Steigerwald CC: Gopala Krishna , Christoph Hellwig , Chris Wedgwood , nscott@aconex.com, xfs@oss.sgi.com Subject: Re: Question related to XFS sync , especially fsync References: <478DEFF0.40004@sgi.com> (sfid-20080116_130938_790120_481702E4) <200801162217.35594.Martin@lichtvoll.de> In-Reply-To: <200801162217.35594.Martin@lichtvoll.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/5488/Wed Jan 16 12:44:30 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14157 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Martin Steigerwald wrote: > Am Mittwoch 16 Januar 2008 schrieb Mark Goodwin: >> Gopala, >> >> it sounds like you want something like NDMP. Check that out first. > > Is there an open source implementation available for this protocol? Would > be interesting to know. See http://www.ndmp.org for the FAQ, spec, etc. THere is a download area with an SDK but no open source version that I know of. Perhaps a new project is born ;-) Cheers -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Wed Jan 16 17:24:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jan 2008 17:24:52 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0H1Oihx023901 for ; Wed, 16 Jan 2008 17:24:46 -0800 X-ASG-Debug-ID: 1200533102-766200010000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx2.suse.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2684E52A922 for ; Wed, 16 Jan 2008 17:25:02 -0800 (PST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id sEIKgIYnETQ9CRfD for ; Wed, 16 Jan 2008 17:25:02 -0800 (PST) X-ASG-Whitelist: Client Received: from Relay1.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 48EB32F839; Thu, 17 Jan 2008 02:25:00 +0100 (CET) To: "Gopala Krishna" Cc: "Chris Wedgwood" , nscott@aconex.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Question related to XFS sync , especially fsync Subject: Re: Question related to XFS sync , especially fsync From: Andi Kleen References: <20080114224245.GT155259@sgi.com> <478CCEAC.9010008@sandeen.net> <1200436012.9463.184.camel@edge.scott.net.au> <20080116064840.GA5725@puku.stupidest.org> Date: Thu, 17 Jan 2008 02:25:00 +0100 In-Reply-To: (Gopala Krishna's message of "Wed\, 16 Jan 2008 12\:55\:17 +0530") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Barracuda-Connect: mx2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1200533103 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/5488/Wed Jan 16 12:44:30 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14158 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: andi@firstfloor.org Precedence: bulk X-list: xfs "Gopala Krishna" writes: > we need to get information about > file like it's extent information and associated block numbers etc. To > extract these there is no system call Actually there is the FIOBMAP ioctl for data blocks. e.g. it's used by boot loaders like lilo to create a block map to read a file without knowledge of the file system. Should work on all file systems that support lilo. It won't give you information about metadata blocks though. -Andi From owner-xfs@oss.sgi.com Wed Jan 16 18:30:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jan 2008 18:31:03 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0H2UpIi027251 for ; Wed, 16 Jan 2008 18:30:53 -0800 X-ASG-Debug-ID: 1200537069-325c00700000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 57207C6CBB0 for ; Wed, 16 Jan 2008 18:31:10 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id 8RnBLOPylkEyXepf for ; Wed, 16 Jan 2008 18:31:10 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 58F3B18D90764; Wed, 16 Jan 2008 20:31:08 -0600 (CST) Message-ID: <478EBDEC.2070305@sandeen.net> Date: Wed, 16 Jan 2008 20:31:08 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Mark Magpayo CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Repairing a possibly incomplete xfs_growfs command? Subject: Re: Repairing a possibly incomplete xfs_growfs command? References: <9CE70E6ED2C2F64FB5537A2973FA4F0253594C@pvn-3001.purevideo.local> In-Reply-To: <9CE70E6ED2C2F64FB5537A2973FA4F0253594C@pvn-3001.purevideo.local> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200537070 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39701 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5488/Wed Jan 16 12:44:30 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14159 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 Mark Magpayo wrote: > Hi, > > So I have run across a strange situation which I hope there are some > gurus out there to help. > > The original setup was a logical volume of 8.9TB. I extended the volume > to 17.7TB and attempted to run xfs_growfs. I am not sure whether the > command actually finished, as after I ran the command, the metadata was > displayed, but there was no nothing that stated the the number of data > blocks had changed. I was just returned to the prompt, so I'm not sure > whether the command completed or not.. > > I was unable write to the logical volume I had just created. I tried to > remount it, but I kept getting an error saying the superblock could not > be read. I tried running an xfs_repair on the filesystem, and get the > following: > > Phase 1 - find and verify superblock... > superblock read failed, offset 19504058859520, size 2048, ag 64, rval 0 > > fatal error -- Invalid argument hm, how big is your block device for starters - look in /proc/partitions. -Eric From owner-xfs@oss.sgi.com Wed Jan 16 18:44:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jan 2008 18:44:44 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0H2ibOr028557 for ; Wed, 16 Jan 2008 18:44:39 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA01222; Thu, 17 Jan 2008 13:44:52 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0H2inLF27715953; Thu, 17 Jan 2008 13:44:50 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0H2ih8s27721251; Thu, 17 Jan 2008 13:44:43 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 17 Jan 2008 13:44:43 +1100 From: David Chinner To: Andi Kleen Cc: Gopala Krishna , Chris Wedgwood , nscott@aconex.com, xfs@oss.sgi.com Subject: Re: Question related to XFS sync , especially fsync Message-ID: <20080117024443.GG155259@sgi.com> References: <20080114224245.GT155259@sgi.com> <478CCEAC.9010008@sandeen.net> <1200436012.9463.184.camel@edge.scott.net.au> <20080116064840.GA5725@puku.stupidest.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5488/Wed Jan 16 12:44:30 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14160 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Thu, Jan 17, 2008 at 02:25:00AM +0100, Andi Kleen wrote: > "Gopala Krishna" writes: > > > we need to get information about > > file like it's extent information and associated block numbers etc. > To > > extract these there is no system call > > Actually there is the FIOBMAP ioctl for data blocks. e.g. it's used by > boot loaders like lilo to create a block map to read a file without > knowledge of the file system. Should work on all file systems that > support lilo. On XFS, you should use XFS_IOC_GETBMAPX. It's much faster and returns lots more information than FIOBMAP. It can also be used on the attribute fork of the inode, and it works on directories as well. Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Wed Jan 16 19:01:05 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jan 2008 19:01:11 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0H311Hw030158 for ; Wed, 16 Jan 2008 19:01:03 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA01636; Thu, 17 Jan 2008 14:01:15 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0H31DLF27661237; Thu, 17 Jan 2008 14:01:14 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0H31BA627713276; Thu, 17 Jan 2008 14:01:11 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 17 Jan 2008 14:01:11 +1100 From: David Chinner To: Mark Magpayo Cc: xfs@oss.sgi.com Subject: Re: Repairing a possibly incomplete xfs_growfs command? Message-ID: <20080117030111.GH155259@sgi.com> References: <9CE70E6ED2C2F64FB5537A2973FA4F0253594C@pvn-3001.purevideo.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9CE70E6ED2C2F64FB5537A2973FA4F0253594C@pvn-3001.purevideo.local> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5488/Wed Jan 16 12:44:30 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14161 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Wed, Jan 16, 2008 at 03:19:19PM -0800, Mark Magpayo wrote: > Hi, > > So I have run across a strange situation which I hope there are some > gurus out there to help. > > The original setup was a logical volume of 8.9TB. I extended the volume > to 17.7TB and attempted to run xfs_growfs. I am not sure whether the > command actually finished, as after I ran the command, the metadata was > displayed, but there was no nothing that stated the the number of data > blocks had changed. I was just returned to the prompt, so I'm not sure > whether the command completed or not.. Hmmm - what kernel and what version of xfsprogs are you using? (xfs_growfs -V). Also, can you post the output of the growfs command if you still have it? If not, the output of: # xfs_db -r -c 'sb 0' -c p # xfs_db -r -c 'sb 1' -c p because: > I was unable write to the logical volume I had just created. I tried to > remount it, but I kept getting an error saying the superblock could not > be read. I tried running an xfs_repair on the filesystem, and get the > following: > > Phase 1 - find and verify superblock... > superblock read failed, offset 19504058859520, size 2048, ag 64, rval 0 That's a weird size for a superblock, and I suspect you should only have AG's numbered 0-63 in your filesystem. (a 8.9TB filesystem will have 32 AGs (0-31) by default, and doubling the size will take it up to 64). > I am not very experienced with xfs (I was following commands in some > documentaion), and I was recommended to post to this mailing list. If > anyone could provide some help, it would be greatly appreciate. Also, > if there is any information I can provide to help, I will gladly provide > it. Thanks in advance! Seeing as the filesystem has not mounted, I think this should be recoverable if you don't try to mount or write anything to the filesystem until we fix the geometry back up.... Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Thu Jan 17 09:34:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 09:34:30 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0HHYQPA016435 for ; Thu, 17 Jan 2008 09:34:26 -0800 X-ASG-Debug-ID: 1200591281-370701380000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.purevideo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A55F3C71EFC for ; Thu, 17 Jan 2008 09:34:41 -0800 (PST) Received: from mail.purevideo.com (mail.purevideo.com [208.50.29.149]) by cuda.sgi.com with ESMTP id O9pGFzzRYD2mlNwG for ; Thu, 17 Jan 2008 09:34:41 -0800 (PST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-ASG-Orig-Subj: RE: Repairing a possibly incomplete xfs_growfs command? Subject: RE: Repairing a possibly incomplete xfs_growfs command? Date: Thu, 17 Jan 2008 09:29:22 -0800 Message-ID: <9CE70E6ED2C2F64FB5537A2973FA4F02535951@pvn-3001.purevideo.local> In-Reply-To: <20080117030111.GH155259@sgi.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Repairing a possibly incomplete xfs_growfs command? Thread-Index: AchYtI4MxpSafxUdTpibUA+qJF4k8QAeloBw References: <9CE70E6ED2C2F64FB5537A2973FA4F0253594C@pvn-3001.purevideo.local> <20080117030111.GH155259@sgi.com> From: "Mark Magpayo" To: "David Chinner" Cc: X-Barracuda-Connect: mail.purevideo.com[208.50.29.149] X-Barracuda-Start-Time: 1200591284 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39714 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5491/Thu Jan 17 07:13:54 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m0HHYRPA016438 X-archive-position: 14162 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: mmagpayo@purevideo.com Precedence: bulk X-list: xfs > -----Original Message----- > From: xfs-bounce@oss.sgi.com [mailto:xfs-bounce@oss.sgi.com] On Behalf Of > David Chinner > Sent: Wednesday, January 16, 2008 7:01 PM > To: Mark Magpayo > Cc: xfs@oss.sgi.com > Subject: Re: Repairing a possibly incomplete xfs_growfs command? > > On Wed, Jan 16, 2008 at 03:19:19PM -0800, Mark Magpayo wrote: > > Hi, > > > > So I have run across a strange situation which I hope there are some > > gurus out there to help. > > > > The original setup was a logical volume of 8.9TB. I extended the volume > > to 17.7TB and attempted to run xfs_growfs. I am not sure whether the > > command actually finished, as after I ran the command, the metadata was > > displayed, but there was no nothing that stated the the number of data > > blocks had changed. I was just returned to the prompt, so I'm not sure > > whether the command completed or not.. > > Hmmm - what kernel and what version of xfsprogs are you using? > (xfs_growfs -V). > xfs_growfs version 2.9.4 > Also, can you post the output of the growfs command if you still > have it? > > If not, the output of: > > # xfs_db -r -c 'sb 0' -c p #xfs_db -r -c 'sb 0' -c p /dev/vg0/lv0 magicnum = 0x58465342 blocksize = 4096 dblocks = 11904332800 rblocks = 0 rextents = 0 uuid = 05d4f6ba-1e9c-4564-898b-98088c163fe1 logstart = 2147483652 rootino = 128 rbmino = 129 rsumino = 130 rextsize = 16 agblocks = 74402080 agcount = 160 rbmblocks = 0 logblocks = 32768 versionnum = 0x3094 sectsize = 512 inodesize = 256 inopblock = 16 fname = "\000\000\000\000\000\000\000\000\000\000\000\000" blocklog = 12 sectlog = 9 inodelog = 8 inopblog = 4 agblklog = 27 rextslog = 0 inprogress = 0 imax_pct = 25 icount = 1335040 ifree = 55 fdblocks = 9525955616 frextents = 0 uquotino = 0 gquotino = 0 qflags = 0 flags = 0 shared_vn = 0 inoalignmt = 2 unit = 0 width = 0 dirblklog = 0 logsectlog = 0 logsectsize = 0 logsunit = 0 features2 = 0 > # xfs_db -r -c 'sb 1' -c p > #xfs_db -r -c 'sb 1' -c p /dev/vg0/lv0 magicnum = 0x58465342 blocksize = 4096 dblocks = 2380866560 rblocks = 0 rextents = 0 uuid = 05d4f6ba-1e9c-4564-898b-98088c163fe1 logstart = 2147483652 rootino = 128 rbmino = 129 rsumino = 130 rextsize = 16 agblocks = 74402080 agcount = 32 rbmblocks = 0 logblocks = 32768 versionnum = 0x3094 sectsize = 512 inodesize = 256 inopblock = 16 fname = "\000\000\000\000\000\000\000\000\000\000\000\000" blocklog = 12 sectlog = 9 inodelog = 8 inopblog = 4 agblklog = 27 rextslog = 0 inprogress = 0 imax_pct = 25 icount = 1334912 ifree = 59 fdblocks = 2809815 frextents = 0 uquotino = 0 gquotino = 0 qflags = 0 flags = 0 shared_vn = 0 inoalignmt = 2 unit = 0 width = 0 dirblklog = 0 logsectlog = 0 logsectsize = 0 logsunit = 0 features2 = 0 > because: > > > I was unable write to the logical volume I had just created. I tried to > > remount it, but I kept getting an error saying the superblock could not > > be read. I tried running an xfs_repair on the filesystem, and get the > > following: > > > > Phase 1 - find and verify superblock... > > superblock read failed, offset 19504058859520, size 2048, ag 64, rval 0 > > That's a weird size for a superblock, and I suspect you should only > have AG's numbered 0-63 in your filesystem. (a 8.9TB filesystem will > have 32 AGs (0-31) by default, and doubling the size will take it > up to 64). > > > I am not very experienced with xfs (I was following commands in some > > documentaion), and I was recommended to post to this mailing list. If > > anyone could provide some help, it would be greatly appreciate. Also, > > if there is any information I can provide to help, I will gladly provide > > it. Thanks in advance! > > Seeing as the filesystem has not mounted, I think this should be > recoverable if you don't try to mount or write anything to the > filesystem until we fix the geometry back up.... > > Cheers, > > Dave. > -- > Dave Chinner > Principal Engineer > SGI Australian Software Group > Someone else asked for the size of the block devices... here's the output from /proc/partitions: 152 0 9523468862 etherd/e1.0 152 16 9523468862 etherd/e0.0 I appreciate everyone's help! Thanks, Mark From owner-xfs@oss.sgi.com Thu Jan 17 12:08:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 12:08:49 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0HK8hdj030752 for ; Thu, 17 Jan 2008 12:08:45 -0800 X-ASG-Debug-ID: 1200600538-734701700000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4FEA052F78B for ; Thu, 17 Jan 2008 12:08:59 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by cuda.sgi.com with ESMTP id 3g2F8CnzT8jUPaiT for ; Thu, 17 Jan 2008 12:08:59 -0800 (PST) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m0HJAomd017668; Thu, 17 Jan 2008 14:10:50 -0500 Received: from lacrosse.corp.redhat.com (lacrosse.corp.redhat.com [172.16.52.154]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m0HJAnlA000516; Thu, 17 Jan 2008 14:10:49 -0500 Received: from neon.msp.redhat.com (neon.msp.redhat.com [10.15.80.10]) by lacrosse.corp.redhat.com (8.12.11.20060308/8.11.6) with ESMTP id m0HJAiM4019046; Thu, 17 Jan 2008 14:10:47 -0500 Message-ID: <478FA832.7030200@sandeen.net> Date: Thu, 17 Jan 2008 13:10:42 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: Mark Magpayo CC: David Chinner , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Repairing a possibly incomplete xfs_growfs command? Subject: Re: Repairing a possibly incomplete xfs_growfs command? References: <9CE70E6ED2C2F64FB5537A2973FA4F0253594C@pvn-3001.purevideo.local> <20080117030111.GH155259@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F02535951@pvn-3001.purevideo.local> In-Reply-To: <9CE70E6ED2C2F64FB5537A2973FA4F02535951@pvn-3001.purevideo.local> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Barracuda-Connect: mx1.redhat.com[66.187.233.31] X-Barracuda-Start-Time: 1200600542 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39725 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14163 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 Mark Magpayo wrote: > Someone else asked for the size of the block devices... here's the > output from /proc/partitions: > > 152 0 9523468862 etherd/e1.0 > 152 16 9523468862 etherd/e0.0 are those two assembled into your actual block device? They look each about 8T. Is the lvm device also in /proc/partitions? -Eric From owner-xfs@oss.sgi.com Thu Jan 17 12:10:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 12:10:22 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0HKAFst031000 for ; Thu, 17 Jan 2008 12:10:18 -0800 X-ASG-Debug-ID: 1200600632-7ae303360000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.purevideo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2C2E4C777BA for ; Thu, 17 Jan 2008 12:10:32 -0800 (PST) Received: from mail.purevideo.com (mail.purevideo.com [208.50.29.149]) by cuda.sgi.com with ESMTP id O4ha35fHTRDoxFZX for ; Thu, 17 Jan 2008 12:10:32 -0800 (PST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-ASG-Orig-Subj: RE: Repairing a possibly incomplete xfs_growfs command? Subject: RE: Repairing a possibly incomplete xfs_growfs command? Date: Thu, 17 Jan 2008 12:04:47 -0800 Message-ID: <9CE70E6ED2C2F64FB5537A2973FA4F02535954@pvn-3001.purevideo.local> In-Reply-To: <478FA832.7030200@sandeen.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Repairing a possibly incomplete xfs_growfs command? Thread-Index: AchZQC5sODYdpjb1St20lBiaF27SXQABPn4Q References: <9CE70E6ED2C2F64FB5537A2973FA4F02535951@pvn-3001.purevideo.local> <478FA832.7030200@sandeen.net> From: "Mark Magpayo" To: "Eric Sandeen" Cc: "David Chinner" , X-Barracuda-Connect: mail.purevideo.com[208.50.29.149] X-Barracuda-Start-Time: 1200600634 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39726 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m0HKAIst031014 X-archive-position: 14164 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: mmagpayo@purevideo.com Precedence: bulk X-list: xfs > -----Original Message----- > From: Eric Sandeen [mailto:sandeen@sandeen.net] > Sent: Thursday, January 17, 2008 11:11 AM > To: Mark Magpayo > Cc: David Chinner; xfs@oss.sgi.com > Subject: Re: Repairing a possibly incomplete xfs_growfs command? > > Mark Magpayo wrote: > > > Someone else asked for the size of the block devices... here's the > > output from /proc/partitions: > > > > 152 0 9523468862 etherd/e1.0 > > 152 16 9523468862 etherd/e0.0 > > > are those two assembled into your actual block device? They look each > about 8T. > > Is the lvm device also in /proc/partitions? > > -Eric Here's the entire output: major minor #blocks name 3 0 512000 hda 3 1 511528 hda1 152 0 9523468862 etherd/e1.0 152 16 9523468862 etherd/e0.0 254 0 19046932480 dm-0 I believe dm-0 is the lvm device. Thanks, Mark From owner-xfs@oss.sgi.com Thu Jan 17 14:19:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 14:19:55 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0HMJlQs020061 for ; Thu, 17 Jan 2008 14:19:48 -0800 X-ASG-Debug-ID: 1200608402-16fa014a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E6AD85306CA for ; Thu, 17 Jan 2008 14:20:02 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id v9BVXo89fWwVol9k for ; Thu, 17 Jan 2008 14:20:02 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id AB84A18D92240; Thu, 17 Jan 2008 16:19:59 -0600 (CST) Message-ID: <478FD48F.1060707@sandeen.net> Date: Thu, 17 Jan 2008 16:19:59 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Mark Magpayo CC: David Chinner , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Repairing a possibly incomplete xfs_growfs command? Subject: Re: Repairing a possibly incomplete xfs_growfs command? References: <9CE70E6ED2C2F64FB5537A2973FA4F02535951@pvn-3001.purevideo.local> <478FA832.7030200@sandeen.net> <9CE70E6ED2C2F64FB5537A2973FA4F02535954@pvn-3001.purevideo.local> In-Reply-To: <9CE70E6ED2C2F64FB5537A2973FA4F02535954@pvn-3001.purevideo.local> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200608405 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39733 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14165 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 Mark Magpayo wrote: > Here's the entire output: > > major minor #blocks name > > 3 0 512000 hda > 3 1 511528 hda1 > 152 0 9523468862 etherd/e1.0 > 152 16 9523468862 etherd/e0.0 > 254 0 19046932480 dm-0 > > > I believe dm-0 is the lvm device. Yep, in 1k units, so: 19046932480*1024 19504058859520 and: superblock read failed, offset 19504058859520, size 2048, ag 64, rval 0 so it's trying to read a 2k (?) superblock right in the last 1k of the device? Hrm. (Dave, Barry - isn't that 2048 the sector size, not block size?) Also from your sb 0 printout: blocksize = 4096 dblocks = 11904332800 is 48760147148800, exactly 2.5x bigger than your device is. Weird. -Eric From owner-xfs@oss.sgi.com Thu Jan 17 14:44:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 14:44:30 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0HMiJOS022764 for ; Thu, 17 Jan 2008 14:44:25 -0800 X-ASG-Debug-ID: 1200609877-24fc006d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from postoffice.aconex.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 41B88530A41 for ; Thu, 17 Jan 2008 14:44:37 -0800 (PST) Received: from postoffice.aconex.com (prod.aconex.com [203.89.192.138]) by cuda.sgi.com with ESMTP id KFzvBJk4gLaWQV4K for ; Thu, 17 Jan 2008 14:44:37 -0800 (PST) Received: from edge.scott.net.au (unknown [203.89.192.141]) by postoffice.aconex.com (Postfix) with ESMTP id 03EED92D0BE; Fri, 18 Jan 2008 09:44:36 +1100 (EST) X-ASG-Orig-Subj: Re: Repairing a possibly incomplete xfs_growfs command? Subject: Re: Repairing a possibly incomplete xfs_growfs command? From: Nathan Scott Reply-To: nscott@aconex.com To: Eric Sandeen Cc: Mark Magpayo , David Chinner , xfs@oss.sgi.com In-Reply-To: <478FD48F.1060707@sandeen.net> References: <9CE70E6ED2C2F64FB5537A2973FA4F02535951@pvn-3001.purevideo.local> <478FA832.7030200@sandeen.net> <9CE70E6ED2C2F64FB5537A2973FA4F02535954@pvn-3001.purevideo.local> <478FD48F.1060707@sandeen.net> Content-Type: text/plain Organization: Aconex Date: Fri, 18 Jan 2008 09:47:34 +1100 Message-Id: <1200610054.9463.218.camel@edge.scott.net.au> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: prod.aconex.com[203.89.192.138] X-Barracuda-Start-Time: 1200609878 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39733 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14166 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: nscott@aconex.com Precedence: bulk X-list: xfs On Thu, 2008-01-17 at 16:19 -0600, Eric Sandeen wrote: > > Yep, in 1k units, so: > > 19046932480*1024 > 19504058859520 > > and: > > superblock read failed, offset 19504058859520, size 2048, ag 64, rval > 0 > > so it's trying to read a 2k (?) superblock right in the last 1k of the > device? Hrm. (Dave, Barry - isn't that 2048 the sector size, not > block > size?) > > Also from your sb 0 printout: > > blocksize = 4096 > dblocks = 11904332800 sectsize = 512 sectlog = 9 So, SB reckons its a regular 512 byte sector size. Perhaps the device driver is reporting a 2K sector size from the BLKSSZGET ioctl? That'd be wierd, cos mkfs would have issued a warning when creating with 512 byte sectors. *shrug*. > is 48760147148800, exactly 2.5x bigger than your device is. Weird. cheers. -- Nathan From owner-xfs@oss.sgi.com Thu Jan 17 15:15:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 15:15:19 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0HNF7wZ027393 for ; Thu, 17 Jan 2008 15:15:11 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id KAA00228; Fri, 18 Jan 2008 10:15:21 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0HNFJLF28714061; Fri, 18 Jan 2008 10:15:20 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0HNFHPA28844149; Fri, 18 Jan 2008 10:15:17 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Fri, 18 Jan 2008 10:15:17 +1100 From: David Chinner To: Mark Magpayo Cc: xfs@oss.sgi.com Subject: Re: Repairing a possibly incomplete xfs_growfs command? Message-ID: <20080117231517.GF155407@sgi.com> References: <9CE70E6ED2C2F64FB5537A2973FA4F0253594C@pvn-3001.purevideo.local> <20080117030111.GH155259@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F02535951@pvn-3001.purevideo.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9CE70E6ED2C2F64FB5537A2973FA4F02535951@pvn-3001.purevideo.local> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14167 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Thu, Jan 17, 2008 at 09:29:22AM -0800, Mark Magpayo wrote: > > On Wed, Jan 16, 2008 at 03:19:19PM -0800, Mark Magpayo wrote: > > > Hi, > > > > > > So I have run across a strange situation which I hope there > > > are some gurus out there to help. > > > > > > The original setup was a logical volume of 8.9TB. I extended > > > the volume to 17.7TB and attempted to run xfs_growfs. I am > > > not sure whether the command actually finished, as after I ran > > > the command, the metadata was displayed, but there was no > > > nothing that stated the the number of data blocks had changed. > > > I was just returned to the prompt, so I'm not sure whether the > > > command completed or not.. > > > > Hmmm - what kernel and what version of xfsprogs are you using? > > (xfs_growfs -V). > > xfs_growfs version 2.9.4 Ok, that's recent - what kernel? (uname -a) > > Also, can you post the output of the growfs command if you still > > have it? > > > > If not, the output of: > > > > # xfs_db -r -c 'sb 0' -c p > > #xfs_db -r -c 'sb 0' -c p /dev/vg0/lv0 > magicnum = 0x58465342 > blocksize = 4096 > dblocks = 11904332800 = 44TB? .... > agblocks = 74402080 = ~283GB > agcount = 160 160*283GB = 44TB. Hold on - 160 AGs? I saw this exact same growfs failure signature just before Christmas at a customer site on an old kernel and xfsprogs. I really need to know what kernel you are running to determine if we may have fixed this bug or not.... But, I did manage to recover that filesystem successfully, so I can give you a simple recipe to fix it up and it won't take me 4 hours on IRC to understand the scope of the damage completely. BTW, if you wanted 18TB, that should be ~64AGs at that size AG so my initial suspicion was confirmed.... > rbmblocks = 0 > logblocks = 32768 > versionnum = 0x3094 .... > icount = 1335040 > ifree = 55 > fdblocks = 9525955616 = 35TB So the free block count got updated as well. Ok, that means once we've fixed up the number of AGs and block count, we'll need to run xfs_repair to ensure all the accounting is correct.... So the superblock in AG1 shoul dhave the original (pre-grow) geometry in it: > #xfs_db -r -c 'sb 1' -c p /dev/vg0/lv0 > magicnum = 0x58465342 > blocksize = 4096 > dblocks = 2380866560 = 8.9TB .... > agblocks = 74402080 > agcount = 32 Yup, 32 AGs originally. > rbmblocks = 0 > logblocks = 32768 > versionnum = 0x3094 .... > icount = 1334912 > ifree = 59 > fdblocks = 2809815 Yeah, you didn't have much free space, did you? ;) FWIW: sb.0.fdblocks - (sb.0.dblocks - sb.1.dblocks) = 9525955616 - (11904332800 - 2380866560) = 2489376 Which means we can use simple subtraction to fix up the free block count. You'll need to run xfs_reapir to fix this after we've fixed the geometry. The way to fix this is to manually fix up the agcount and dblocks in all the AGs. Seeing as you simply doubled the volume size, that is relatively easy to do. dblocks should be 2*2380866560 = 4761733120 blocks = 19,046,932,480 bytes. Your device is 19,504,058,859,520 bytes in size, so this should fit just fine. # for i in `seq 0 1 63`; do > xfs_db -x -c "sb $i" -c 'write agcount 64' -c 'write dblock 4761733120' /dev/vg0/lv0 > done Then run 'xfs_repair -n /dev/vg0/lv0' to check that phase 1 will pass (i.e. it can read the last block of the filesystem). If phase 1 completes, then you can kill it and run xfs_repair again without the '-n' flag. Once that completes, you should have a mountable filesystem that is ~18TB in size. If you want, once you've mounted it run xfs_growfs again to extend the filesystem completely to the end of new device.... Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Thu Jan 17 15:34:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 15:34:19 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0HNYCA3029493 for ; Thu, 17 Jan 2008 15:34:15 -0800 X-ASG-Debug-ID: 1200612871-6309022e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.purevideo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 95051C7A269 for ; Thu, 17 Jan 2008 15:34:31 -0800 (PST) Received: from mail.purevideo.com (mail.purevideo.com [208.50.29.149]) by cuda.sgi.com with ESMTP id 5j1KrsGmhHmVLbYU for ; Thu, 17 Jan 2008 15:34:31 -0800 (PST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-ASG-Orig-Subj: RE: Repairing a possibly incomplete xfs_growfs command? Subject: RE: Repairing a possibly incomplete xfs_growfs command? Date: Thu, 17 Jan 2008 15:29:17 -0800 Message-ID: <9CE70E6ED2C2F64FB5537A2973FA4F0253595A@pvn-3001.purevideo.local> In-Reply-To: <20080117231517.GF155407@sgi.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Repairing a possibly incomplete xfs_growfs command? Thread-Index: AchZXh8u0XsFC3fDQVqZiBKwHAgLBQAAndYw References: <9CE70E6ED2C2F64FB5537A2973FA4F0253594C@pvn-3001.purevideo.local> <20080117030111.GH155259@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F02535951@pvn-3001.purevideo.local> <20080117231517.GF155407@sgi.com> From: "Mark Magpayo" To: "David Chinner" Cc: X-Barracuda-Connect: mail.purevideo.com[208.50.29.149] X-Barracuda-Start-Time: 1200612871 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39738 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m0HNYFA3029499 X-archive-position: 14168 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: mmagpayo@purevideo.com Precedence: bulk X-list: xfs > -----Original Message----- > From: David Chinner [mailto:dgc@sgi.com] > Sent: Thursday, January 17, 2008 3:15 PM > To: Mark Magpayo > Cc: xfs@oss.sgi.com > Subject: Re: Repairing a possibly incomplete xfs_growfs command? > > On Thu, Jan 17, 2008 at 09:29:22AM -0800, Mark Magpayo wrote: > > > On Wed, Jan 16, 2008 at 03:19:19PM -0800, Mark Magpayo wrote: > > > > Hi, > > > > > > > > So I have run across a strange situation which I hope there > > > > are some gurus out there to help. > > > > > > > > The original setup was a logical volume of 8.9TB. I extended > > > > the volume to 17.7TB and attempted to run xfs_growfs. I am > > > > not sure whether the command actually finished, as after I ran > > > > the command, the metadata was displayed, but there was no > > > > nothing that stated the the number of data blocks had changed. > > > > I was just returned to the prompt, so I'm not sure whether the > > > > command completed or not.. > > > > > > Hmmm - what kernel and what version of xfsprogs are you using? > > > (xfs_growfs -V). > > > > xfs_growfs version 2.9.4 > > Ok, that's recent - what kernel? (uname -a) > > > > Also, can you post the output of the growfs command if you still > > > have it? > > > > > > If not, the output of: > > > > > > # xfs_db -r -c 'sb 0' -c p > > > > #xfs_db -r -c 'sb 0' -c p /dev/vg0/lv0 > > magicnum = 0x58465342 > > blocksize = 4096 > > dblocks = 11904332800 > > = 44TB? > .... > > agblocks = 74402080 > = ~283GB > > > agcount = 160 > > 160*283GB = 44TB. > > Hold on - 160 AGs? I saw this exact same growfs failure signature > just before Christmas at a customer site on an old kernel and > xfsprogs. I really need to know what kernel you are running to > determine if we may have fixed this bug or not.... > > But, I did manage to recover that filesystem successfully, > so I can give you a simple recipe to fix it up and it won't > take me 4 hours on IRC to understand the scope of the damage > completely. > > BTW, if you wanted 18TB, that should be ~64AGs at that size AG > so my initial suspicion was confirmed.... > > > rbmblocks = 0 > > logblocks = 32768 > > versionnum = 0x3094 > .... > > icount = 1335040 > > ifree = 55 > > fdblocks = 9525955616 > = 35TB > > So the free block count got updated as well. > > Ok, that means once we've fixed up the number of AGs and block > count, we'll need to run xfs_repair to ensure all the accounting > is correct.... > > > So the superblock in AG1 shoul dhave the original (pre-grow) > geometry in it: > > > #xfs_db -r -c 'sb 1' -c p /dev/vg0/lv0 > > magicnum = 0x58465342 > > blocksize = 4096 > > dblocks = 2380866560 > > = 8.9TB > .... > > agblocks = 74402080 > > agcount = 32 > > Yup, 32 AGs originally. > > > rbmblocks = 0 > > logblocks = 32768 > > versionnum = 0x3094 > .... > > icount = 1334912 > > ifree = 59 > > fdblocks = 2809815 > > Yeah, you didn't have much free space, did you? ;) > > FWIW: sb.0.fdblocks - (sb.0.dblocks - sb.1.dblocks) > = 9525955616 - (11904332800 - 2380866560) > = 2489376 > > Which means we can use simple subtraction to fix up the free > block count. You'll need to run xfs_reapir to fix this after > we've fixed the geometry. > > The way to fix this is to manually fix up the agcount > and dblocks in all the AGs. Seeing as you simply doubled the > volume size, that is relatively easy to do. dblocks should > be 2*2380866560 = 4761733120 blocks = 19,046,932,480 bytes. > > Your device is 19,504,058,859,520 bytes in size, so this should > fit just fine. > > # for i in `seq 0 1 63`; do > > xfs_db -x -c "sb $i" -c 'write agcount 64' -c 'write dblock 4761733120' > /dev/vg0/lv0 > > done > > Then run 'xfs_repair -n /dev/vg0/lv0' to check that phase 1 will > pass (i.e. it can read the last block of the filesystem). If phase > 1 completes, then you can kill it and run xfs_repair again without > the '-n' flag. > > Once that completes, you should have a mountable filesystem that is > ~18TB in size. > > If you want, once you've mounted it run xfs_growfs again to extend > the filesystem completely to the end of new device.... > > Cheers, > > Dave. > -- > Dave Chinner > Principal Engineer > SGI Australian Software Group This is quite a relief to know that this is a fairly straightforward fix! What luck that you had encountered it recently, I really appreciate the help. Here's my uname output: Linux purenas 2.6.16.55-c1 #1 SMP Fri Oct 19 16:45:15 EDT 2007 x86_64 GNU/Linux Maybe you guys fixed the bug already? iirc, I may have run xfs_growfs with an older version of xfsprogs, then was advised to update to the newest and try it again. I may have run it on a version that still contained the bug? So is this all I need then prior to an xfs_repair?: > # for i in `seq 0 1 63`; do > > xfs_db -x -c "sb $i" -c 'write agcount 64' -c 'write dblock 4761733120' > /dev/vg0/lv0 I really appreciate all of the help everyone has given. =) Thanks, Mark From owner-xfs@oss.sgi.com Thu Jan 17 15:45:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 15:46:00 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0HNjr8V002327 for ; Thu, 17 Jan 2008 15:45:55 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id KAA01325; Fri, 18 Jan 2008 10:46:07 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0HNk5LF28847964; Fri, 18 Jan 2008 10:46:06 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0HNk4x228856334; Fri, 18 Jan 2008 10:46:04 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Fri, 18 Jan 2008 10:46:04 +1100 From: David Chinner To: Mark Magpayo Cc: xfs@oss.sgi.com Subject: Re: Repairing a possibly incomplete xfs_growfs command? Message-ID: <20080117234604.GG155407@sgi.com> References: <9CE70E6ED2C2F64FB5537A2973FA4F0253594C@pvn-3001.purevideo.local> <20080117030111.GH155259@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F02535951@pvn-3001.purevideo.local> <20080117231517.GF155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253595A@pvn-3001.purevideo.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9CE70E6ED2C2F64FB5537A2973FA4F0253595A@pvn-3001.purevideo.local> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14169 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Thu, Jan 17, 2008 at 03:29:17PM -0800, Mark Magpayo wrote: > This is quite a relief to know that this is a fairly straightforward > fix! What luck that you had encountered it recently, I really > appreciate the help. Here's my uname output: > > Linux purenas 2.6.16.55-c1 #1 SMP Fri Oct 19 16:45:15 EDT 2007 x86_64 > GNU/Linux > > Maybe you guys fixed the bug already? /me breathes a sigh of relief I think we have: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=20f4ebf2bf2f57c1a9abb3655391336cc90314b3 [XFS] Make growfs work for amounts greater than 2TB > iirc, I may have run xfs_growfs with an older version of xfsprogs, then > was advised to update to the newest and try it again. I may have run it > on a version that still contained the bug? Kernel bug, not userspace bug, AFAICT. > So is this all I need then prior to an xfs_repair?: > > > # for i in `seq 0 1 63`; do > > > xfs_db -x -c "sb $i" -c 'write agcount 64' -c 'write dblock 4761733120' > > /dev/vg0/lv0 Yes, I think that is all that is necessary (that+repair was what fixed the problem at the customer site successfully). Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Thu Jan 17 16:11:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 16:12:01 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0I0BntF019562 for ; Thu, 17 Jan 2008 16:11:51 -0800 X-ASG-Debug-ID: 1200615126-630802a10000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from fergie.hostexchange.net.au (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A0AC5C7A309 for ; Thu, 17 Jan 2008 16:12:06 -0800 (PST) Received: from fergie.hostexchange.net.au (fergie.hostexchange.net.au [64.34.177.147]) by cuda.sgi.com with ESMTP id F9TvbXPnkbnYxaFp for ; Thu, 17 Jan 2008 16:12:06 -0800 (PST) Received: from localhost (localhost) by fergie.hostexchange.net.au (8.13.4/8.13.4/Debian-3sarge3) id m0I0C5tZ031515; Fri, 18 Jan 2008 11:12:05 +1100 Date: Fri, 18 Jan 2008 11:12:05 +1100 From: Mail Delivery Subsystem Message-Id: <200801180012.m0I0C5tZ031515@fergie.hostexchange.net.au> To: postmaster@fergie.hostexchange.net.au To: MIME-Version: 1.0 Content-Type: multipart/report; report-type=delivery-status; boundary="m0I0C5tZ031515.1200615125/fergie.hostexchange.net.au" X-ASG-Orig-Subj: Returned mail: see transcript for details Subject: Returned mail: see transcript for details Auto-Submitted: auto-generated (failure) X-Barracuda-Connect: fergie.hostexchange.net.au[64.34.177.147] X-Barracuda-Start-Time: 1200615128 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39742 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14170 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: MAILER-DAEMON@fergie.hostexchange.net.au Precedence: bulk X-list: xfs This is a MIME-encapsulated message --m0I0C5tZ031515.1200615125/fergie.hostexchange.net.au The original message was received at Fri, 18 Jan 2008 11:12:02 +1100 from [222.106.183.12] ----- The following addresses had permanent fatal errors ----- ----- Transcript of session follows ----- 554 5.0.0 MX list for d9810.rotary.org.au. points back to fergie.hostexchange.net.au 554 5.3.5 Local configuration error --m0I0C5tZ031515.1200615125/fergie.hostexchange.net.au Content-Type: message/delivery-status Reporting-MTA: dns; fergie.hostexchange.net.au Received-From-MTA: DNS; [222.106.183.12] Arrival-Date: Fri, 18 Jan 2008 11:12:02 +1100 Final-Recipient: RFC822; warrandyte@d9810.rotary.org.au Action: failed Status: 5.5.0 Remote-MTA: DNS; d9810.rotary.org.au Last-Attempt-Date: Fri, 18 Jan 2008 11:12:04 +1100 --m0I0C5tZ031515.1200615125/fergie.hostexchange.net.au Content-Type: text/rfc822-headers Return-Path: Received: from d9810.rotary.org.au ([222.106.183.12]) by fergie.hostexchange.net.au (8.13.4/8.13.4/Debian-3sarge3) with ESMTP id m0I0C1tZ031500 for ; Fri, 18 Jan 2008 11:12:02 +1100 Message-Id: <200801180012.m0I0C1tZ031500@fergie.hostexchange.net.au> From: linux-xfs@oss.sgi.com To: warrandyte@d9810.rotary.org.au Subject: Date: Fri, 18 Jan 2008 09:12:23 +0900 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0016----=_NextPart_000_0016" X-Priority: 3 X-MSMail-Priority: Normal --m0I0C5tZ031515.1200615125/fergie.hostexchange.net.au-- From owner-xfs@oss.sgi.com Thu Jan 17 20:42:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 20:42:32 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_05 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0I4gHte021080 for ; Thu, 17 Jan 2008 20:42:24 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA08036; Fri, 18 Jan 2008 15:42:34 +1100 Date: Fri, 18 Jan 2008 15:43:47 +1100 To: "xfs@oss.sgi.com" Subject: [REVIEW 0/2] Case insensitive support for XFS From: "Barry Naujok" Organization: SGI Cc: xfs-dev Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14171 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs In the following two emails is contains patches for case-insensitive and Unicode support for XFS in Linux. It implements case-insensitivity utilising a Unicode case folding table stored on disk generated from http://www.unicode.org/Public/UNIDATA/CaseFolding.txt As the filesystem stores names as Unicode (UTF-8), the "nls" mount option has been added to support systems not utilising UTF-8 natively. If the nls mount option is not used, it will use the default NLS defined in the kernel's config. To allow case-insensitivity to be a mount option rather than a mkfs option, the hashes stored on disk are always case-folded. This is indicated by the new "unicode" bit in the superblock. This bit also associated with the presence of the case-folding table on disk. This affects both directory and extended attribute names. With the case-folding table on disk, it allows us to upgrade the table in the future while retaining backwards and forwards compatibility. It also allows special case tables such as Turkic case which is supported in this patch set. There are two mount options for enabling case-insensitivity on a Unicode XFS filesystem: - "ci" - enables case-insensitivity for file names - "ciattr" - enables case-insensitivity for extended attributes. xfs_repair and xfs_db are fully aware of the case-folding table. xfs_db has a basic "cft" command which can show the table's header. From owner-xfs@oss.sgi.com Thu Jan 17 20:42:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 20:42:36 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33, J_CHICKENPOX_41,J_CHICKENPOX_42,J_CHICKENPOX_45,J_CHICKENPOX_47, J_CHICKENPOX_48,J_CHICKENPOX_51,J_CHICKENPOX_53,J_CHICKENPOX_55, J_CHICKENPOX_57,J_CHICKENPOX_61,J_CHICKENPOX_62,J_CHICKENPOX_65, J_CHICKENPOX_66,J_CHICKENPOX_71 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0I4gJHN021083 for ; Thu, 17 Jan 2008 20:42:24 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA08039; Fri, 18 Jan 2008 15:42:36 +1100 Date: Fri, 18 Jan 2008 15:43:50 +1100 To: "xfs@oss.sgi.com" Subject: [REVIEW 1/2] Case insensitive support for XFS - kernel patch From: "Barry Naujok" Organization: SGI Cc: xfs-dev Content-Type: multipart/mixed; boundary=----------86aCZzNf3aen1MAxxPn749 MIME-Version: 1.0 Message-ID: User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14172 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs ------------86aCZzNf3aen1MAxxPn749 Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 Content-Transfer-Encoding: 7bit This patch should apply to 2.6.24-rc6. Makefile | 1 linux-2.6/xfs_export.c | 2 linux-2.6/xfs_iops.c | 130 ++++++++++++ linux-2.6/xfs_iops.h | 1 linux-2.6/xfs_ksyms.c | 1 linux-2.6/xfs_linux.h | 8 linux-2.6/xfs_super.c | 31 ++ xfs_attr.c | 47 +++- xfs_attr_leaf.c | 217 +++++++++++--------- xfs_attr_leaf.h | 12 + xfs_clnt.h | 5 xfs_da_btree.c | 95 ++++++++ xfs_da_btree.h | 35 +++ xfs_dir2.c | 141 ++++++++++--- xfs_dir2.h | 10 xfs_dir2_block.c | 63 ++++- xfs_dir2_data.c | 3 xfs_dir2_leaf.c | 48 +++- xfs_dir2_node.c | 36 ++- xfs_dir2_sf.c | 66 ++++-- xfs_itable.c | 2 xfs_mount.c | 26 ++ xfs_mount.h | 12 + xfs_rename.c | 5 xfs_sb.h | 33 ++- xfs_types.h | 5 xfs_unicode.c | 523 +++++++++++++++++++++++++++++++++++++++++++++++++ xfs_unicode.h | 76 +++++++ xfs_utils.c | 10 xfs_utils.h | 2 xfs_vfsops.c | 40 +++ xfs_vnodeops.c | 7 xfs_vnodeops.h | 2 33 files changed, 1495 insertions(+), 200 deletions(-) ------------86aCZzNf3aen1MAxxPn749 Content-Disposition: attachment; filename=ci_kernel.patch Content-Type: text/x-patch; name=ci_kernel.patch Content-Transfer-Encoding: Quoted-Printable =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/Makefile 2008-01-18 15:31:23.000000000 +1100 +++ b/fs/xfs/Makefile 2007-10-23 16:17:22.173903950 +1000 @@ -74,6 +74,7 @@ xfs-y +=3D xfs_alloc.o \ xfs_trans_extfree.o \ xfs_trans_inode.o \ xfs_trans_item.o \ + xfs_unicode.o \ xfs_utils.o \ xfs_vfsops.o \ xfs_vnodeops.o \ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/linux-2.6/xfs_export.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/linux-2.6/xfs_export.c 2008-01-18 15:31:23.000000000 +1100 +++ b/fs/xfs/linux-2.6/xfs_export.c 2008-01-11 14:20:10.000000000 +1100 @@ -217,7 +217,7 @@ xfs_fs_get_parent( struct dentry *parent; = cvp =3D NULL; - error =3D xfs_lookup(XFS_I(child->d_inode), &dotdot, &cvp); + error =3D xfs_lookup(XFS_I(child->d_inode), &dotdot, &cvp, NULL, NULL)= ; if (unlikely(error)) return ERR_PTR(-error); = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/linux-2.6/xfs_iops.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/linux-2.6/xfs_iops.c 2008-01-18 15:31:23.000000000 +1100 +++ b/fs/xfs/linux-2.6/xfs_iops.c 2008-01-17 12:26:26.905427167 +1100 @@ -47,6 +47,8 @@ #include "xfs_buf_item.h" #include "xfs_utils.h" #include "xfs_vnodeops.h" +#include "xfs_da_btree.h" +#include "xfs_unicode.h" = #include #include @@ -388,7 +390,7 @@ xfs_vn_lookup( if (dentry->d_name.len >=3D MAXNAMELEN) return ERR_PTR(-ENAMETOOLONG); = - error =3D xfs_lookup(XFS_I(dir), dentry, &cvp); + error =3D xfs_lookup(XFS_I(dir), dentry, &cvp, NULL, NULL); if (unlikely(error)) { if (unlikely(error !=3D ENOENT)) return ERR_PTR(-error); @@ -399,6 +401,113 @@ xfs_vn_lookup( return d_splice_alias(vn_to_inode(cvp), dentry); } = +STATIC struct dentry * +xfs_vn_ci_lookup( + struct inode *dir, + struct dentry *dentry, + struct nameidata *nd) +{ + bhv_vnode_t *cvp; + int error; + struct dentry *result; + struct qstr actual_name; + struct inode *inode; + + if (dentry->d_name.len >=3D MAXNAMELEN) + return ERR_PTR(-ENAMETOOLONG); + + error =3D xfs_lookup(XFS_I(dir), dentry, &cvp, (char **)&actual_name.n= ame, + &actual_name.len); + if (unlikely(error)) { + if (unlikely(error !=3D ENOENT)) + return ERR_PTR(-error); + d_add(dentry, NULL); + return NULL; + } + inode =3D vn_to_inode(cvp); + + /* if exact match, just splice and exit */ + if (!actual_name.name) { + result =3D d_splice_alias(inode, dentry); + return result; + } + + /* + * case-insensitive match, create a dentry to return and fill it + * in with the correctly cased name. Parameter "dentry" is not + * used anymore and the caller will free it. + * Derived from fs/ntfs/namei.c + */ + + actual_name.hash =3D full_name_hash(actual_name.name, actual_name.len)= ; + + /* Does an existing dentry match? */ + result =3D d_lookup(dentry->d_parent, &actual_name); + if (!result) { + /* if not, create one */ + result =3D d_alloc(dentry->d_parent, &actual_name); + xfs_free_unicode_nls_name((char *)actual_name.name); + if (!result) + return ERR_PTR(-ENOMEM); + dentry =3D d_splice_alias(inode, result); + if (dentry) { + dput(result); + return dentry; + } + return result; + } + xfs_free_unicode_nls_name((char *)actual_name.name); + + /* an existing dentry matches, use it */ + + if (result->d_inode) { + /* + * already an inode attached, deref the inode that was + * refcounted with xfs_lookup and return the dentry. + */ + if (unlikely(result->d_inode !=3D inode)) { + /* This can happen because bad inodes are unhashed. */ + BUG_ON(!is_bad_inode(inode)); + BUG_ON(!is_bad_inode(result->d_inode)); + } + iput(inode); + return result; + } + + if (!S_ISDIR(inode->i_mode)) { + /* not a directory, easy to handle */ + d_instantiate(result, inode); + return result; + } + + spin_lock(&dcache_lock); + if (list_empty(&inode->i_dentry)) { + /* + * Directory without a 'disconnected' dentry; we need to do + * d_instantiate() by hand because it takes dcache_lock which + * we already hold. + */ + list_add(&result->d_alias, &inode->i_dentry); + result->d_inode =3D inode; + spin_unlock(&dcache_lock); + security_d_instantiate(result, inode); + return result; + } + /* + * Directory with a 'disconnected' dentry; get a reference to the + * 'disconnected' dentry. + */ + dentry =3D list_entry(inode->i_dentry.next, struct dentry, d_alias); + dget_locked(dentry); + spin_unlock(&dcache_lock); + security_d_instantiate(result, inode); + d_move(dentry, result); + iput(inode); + dput(result); + return dentry; +} + + STATIC int xfs_vn_link( struct dentry *old_dentry, @@ -868,6 +977,25 @@ const struct inode_operations xfs_dir_in .removexattr =3D xfs_vn_removexattr, }; = +const struct inode_operations xfs_dir_ci_inode_operations =3D { + .create =3D xfs_vn_create, + .lookup =3D xfs_vn_ci_lookup, + .link =3D xfs_vn_link, + .unlink =3D xfs_vn_unlink, + .symlink =3D xfs_vn_symlink, + .mkdir =3D xfs_vn_mkdir, + .rmdir =3D xfs_vn_rmdir, + .mknod =3D xfs_vn_mknod, + .rename =3D xfs_vn_rename, + .permission =3D xfs_vn_permission, + .getattr =3D xfs_vn_getattr, + .setattr =3D xfs_vn_setattr, + .setxattr =3D xfs_vn_setxattr, + .getxattr =3D xfs_vn_getxattr, + .listxattr =3D xfs_vn_listxattr, + .removexattr =3D xfs_vn_removexattr, +}; + const struct inode_operations xfs_symlink_inode_operations =3D { .readlink =3D generic_readlink, .follow_link =3D xfs_vn_follow_link, =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/linux-2.6/xfs_iops.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/linux-2.6/xfs_iops.h 2008-01-18 15:31:24.000000000 +1100 +++ b/fs/xfs/linux-2.6/xfs_iops.h 2007-10-26 13:19:11.702517171 +1000 @@ -20,6 +20,7 @@ = extern const struct inode_operations xfs_inode_operations; extern const struct inode_operations xfs_dir_inode_operations; +extern const struct inode_operations xfs_dir_ci_inode_operations; extern const struct inode_operations xfs_symlink_inode_operations; = extern const struct file_operations xfs_file_operations; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/linux-2.6/xfs_ksyms.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/linux-2.6/xfs_ksyms.c 2008-01-18 15:31:24.000000000 +1100 +++ b/fs/xfs/linux-2.6/xfs_ksyms.c 2008-01-11 14:20:11.000000000 +1100 @@ -157,6 +157,7 @@ EXPORT_SYMBOL(kmem_zone_init); EXPORT_SYMBOL(kmem_zone_zalloc); EXPORT_SYMBOL(xfs_address_space_operations); EXPORT_SYMBOL(xfs_dir_inode_operations); +EXPORT_SYMBOL(xfs_dir_ci_inode_operations); EXPORT_SYMBOL(xfs_dir_file_operations); EXPORT_SYMBOL(xfs_inode_operations); EXPORT_SYMBOL(xfs_file_operations); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/linux-2.6/xfs_linux.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/linux-2.6/xfs_linux.h 2008-01-18 15:31:24.000000000 +1100 +++ b/fs/xfs/linux-2.6/xfs_linux.h 2008-01-11 14:49:16.537591564 +1100 @@ -75,6 +75,8 @@ #include #include #include +#include +#include = #include #include @@ -180,6 +182,12 @@ #define howmany(x, y) (((x)+((y)-1))/(y)) = /* + * NLS UTF-8 character set + */ + +#define XFS_NLS_UTF8 "utf8" + +/* * Various platform dependent calls that don't fit anywhere else */ #define xfs_sort(a,n,s,fn) sort(a,n,s,fn,NULL) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/linux-2.6/xfs_super.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/linux-2.6/xfs_super.c 2008-01-18 15:31:24.000000000 +1100 +++ b/fs/xfs/linux-2.6/xfs_super.c 2008-01-11 14:46:25.067566854 +1100 @@ -50,6 +50,7 @@ #include "xfs_vnodeops.h" #include "xfs_vfsops.h" #include "xfs_version.h" +#include "xfs_unicode.h" #include "xfs_log_priv.h" = #include @@ -121,6 +122,9 @@ xfs_args_allocate( #define MNTOPT_ATTR2 "attr2" /* do use attr2 attribute format */ #define MNTOPT_NOATTR2 "noattr2" /* do not use attr2 attribute format *= / #define MNTOPT_FILESTREAM "filestreams" /* use filestreams allocator *= / +#define MNTOPT_NLS "nls" /* NLS code page to use */ +#define MNTOPT_CILOOKUP "ci" /* case-insensitive dir names */ +#define MNTOPT_CIATTR "ciattr" /* case-insensitive attr names */ #define MNTOPT_QUOTA "quota" /* disk quotas (user) */ #define MNTOPT_NOQUOTA "noquota" /* no quotas */ #define MNTOPT_USRQUOTA "usrquota" /* user quota enabled */ @@ -315,6 +319,18 @@ xfs_parseargs( args->flags &=3D ~XFSMNT_ATTR2; } else if (!strcmp(this_char, MNTOPT_FILESTREAM)) { args->flags2 |=3D XFSMNT2_FILESTREAMS; + } else if (!strcmp(this_char, MNTOPT_NLS)) { + if (!value || !*value) { + cmn_err(CE_WARN, + "XFS: %s option requires an argument", + this_char); + return EINVAL; + } + strncpy(args->nls, value, MAXNAMELEN); + } else if (!strcmp(this_char, MNTOPT_CILOOKUP)) { + args->flags2 |=3D XFSMNT2_CILOOKUP; + } else if (!strcmp(this_char, MNTOPT_CIATTR)) { + args->flags2 |=3D XFSMNT2_CIATTR; } else if (!strcmp(this_char, MNTOPT_NOQUOTA)) { args->flags &=3D ~(XFSMNT_UQUOTAENF|XFSMNT_UQUOTA); args->flags &=3D ~(XFSMNT_GQUOTAENF|XFSMNT_GQUOTA); @@ -454,6 +470,8 @@ xfs_showargs( { XFS_MOUNT_OSYNCISOSYNC, "," MNTOPT_OSYNCISOSYNC }, { XFS_MOUNT_ATTR2, "," MNTOPT_ATTR2 }, { XFS_MOUNT_FILESTREAMS, "," MNTOPT_FILESTREAM }, + { XFS_MOUNT_CI_LOOKUP, "," MNTOPT_CILOOKUP }, + { XFS_MOUNT_CI_ATTR, "," MNTOPT_CIATTR }, { XFS_MOUNT_DMAPI, "," MNTOPT_DMAPI }, { XFS_MOUNT_GRPID, "," MNTOPT_GRPID }, { 0, NULL } @@ -516,6 +534,13 @@ xfs_showargs( if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) seq_puts(m, "," MNTOPT_NOQUOTA); = + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + if (mp->m_nls) + seq_printf(m, "," MNTOPT_NLS "=3D%s", mp->m_nls->charset); + else + seq_puts(m, "," MNTOPT_NLS "=3D" XFS_NLS_UTF8); + } + return 0; } __uint64_t @@ -563,7 +588,11 @@ xfs_set_inodeops( inode->i_mapping->a_ops =3D &xfs_address_space_operations; break; case S_IFDIR: - inode->i_op =3D &xfs_dir_inode_operations; + inode->i_op =3D + xfs_sb_version_hasoldci(&XFS_I(inode)->i_mount->m_sb) || + (XFS_I(inode)->i_mount->m_flags & XFS_MOUNT_CI_LOOKUP) ? + &xfs_dir_ci_inode_operations : + &xfs_dir_inode_operations; inode->i_fop =3D &xfs_dir_file_operations; break; case S_IFLNK: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_attr.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_attr.c 2008-01-18 15:31:24.000000000 +1100 +++ b/fs/xfs/xfs_attr.c 2008-01-18 13:25:20.068339942 +1100 @@ -106,6 +106,17 @@ ktrace_t *xfs_attr_trace_buf; * Overall external interface routines. *=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D*/ = +void +xfs_attr_mount(struct xfs_mount *mp) +{ + mp->m_attr_magicpct =3D (mp->m_sb.sb_blocksize * 37) / 100; + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + mp->m_attrnameops =3D (mp->m_flags & XFS_MOUNT_CI_ATTR) ? + &xfs_unicode_ci_nameops : &xfs_unicode_nameops; + } else + mp->m_attrnameops =3D &xfs_default_nameops; +} + int xfs_attr_fetch(xfs_inode_t *ip, const char *name, int namelen, char *value, int *valuelenp, int flags, struct cred *cred) @@ -122,14 +133,14 @@ xfs_attr_fetch(xfs_inode_t *ip, const ch * Fill in the arg structure for this request. */ memset((char *)&args, 0, sizeof(args)); - args.name =3D name; - args.namelen =3D namelen; args.value =3D value; args.valuelen =3D *valuelenp; args.flags =3D flags; - args.hashval =3D xfs_da_hashname(args.name, args.namelen); args.dp =3D ip; args.whichfork =3D XFS_ATTR_FORK; + error =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (error) + return error; = /* * Decide on what work routines to call based on the inode size. @@ -153,6 +164,7 @@ xfs_attr_fetch(xfs_inode_t *ip, const ch = if (error =3D=3D EEXIST) error =3D 0; + xfs_da_cleanup_name(&args, name); return(error); } = @@ -181,6 +193,7 @@ xfs_attr_get( xfs_ilock(ip, XFS_ILOCK_SHARED); error =3D xfs_attr_fetch(ip, name, namelen, value, valuelenp, flags, c= red); xfs_iunlock(ip, XFS_ILOCK_SHARED); + return(error); } = @@ -219,18 +232,18 @@ xfs_attr_set_int(xfs_inode_t *dp, const = * Fill in the arg structure for this request. */ memset((char *)&args, 0, sizeof(args)); - args.name =3D name; - args.namelen =3D namelen; args.value =3D value; args.valuelen =3D valuelen; args.flags =3D flags; - args.hashval =3D xfs_da_hashname(args.name, args.namelen); args.dp =3D dp; args.firstblock =3D &firstblock; args.flist =3D &flist; args.whichfork =3D XFS_ATTR_FORK; args.addname =3D 1; args.oknoent =3D 1; + error =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (error) + return error; = /* * Determine space new attribute will use, and if it would be @@ -282,6 +295,7 @@ xfs_attr_set_int(xfs_inode_t *dp, const = 0, XFS_TRANS_PERM_LOG_RES, XFS_ATTRSET_LOG_COUNT))) { xfs_trans_cancel(args.trans, 0); + xfs_da_cleanup_name(&args, name); return(error); } xfs_ilock(dp, XFS_ILOCK_EXCL); @@ -292,6 +306,7 @@ xfs_attr_set_int(xfs_inode_t *dp, const = if (error) { xfs_iunlock(dp, XFS_ILOCK_EXCL); xfs_trans_cancel(args.trans, XFS_TRANS_RELEASE_LOG_RES); + xfs_da_cleanup_name(&args, name); return (error); } = @@ -342,6 +357,7 @@ xfs_attr_set_int(xfs_inode_t *dp, const = if (!error && (flags & ATTR_KERNOTIME) =3D=3D 0) { xfs_ichgtime(dp, XFS_ICHGTIME_CHG); } + xfs_da_cleanup_name(&args, name); return(error =3D=3D 0 ? err2 : error); } = @@ -411,6 +427,7 @@ xfs_attr_set_int(xfs_inode_t *dp, const = xfs_ichgtime(dp, XFS_ICHGTIME_CHG); } = + xfs_da_cleanup_name(&args, name); return(error); = out: @@ -418,6 +435,7 @@ out: xfs_trans_cancel(args.trans, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT); xfs_iunlock(dp, XFS_ILOCK_EXCL); + xfs_da_cleanup_name(&args, name); return(error); } = @@ -460,21 +478,23 @@ xfs_attr_remove_int(xfs_inode_t *dp, con * Fill in the arg structure for this request. */ memset((char *)&args, 0, sizeof(args)); - args.name =3D name; - args.namelen =3D namelen; args.flags =3D flags; - args.hashval =3D xfs_da_hashname(args.name, args.namelen); args.dp =3D dp; args.firstblock =3D &firstblock; args.flist =3D &flist; args.total =3D 0; args.whichfork =3D XFS_ATTR_FORK; + error =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (error) + return error; = /* * Attach the dquots to the inode. */ - if ((error =3D XFS_QM_DQATTACH(mp, dp, 0))) + if ((error =3D XFS_QM_DQATTACH(mp, dp, 0))) { + xfs_da_cleanup_name(&args, name); return (error); + } = /* * Start our first transaction of the day. @@ -502,6 +522,7 @@ xfs_attr_remove_int(xfs_inode_t *dp, con 0, XFS_TRANS_PERM_LOG_RES, XFS_ATTRRM_LOG_COUNT))) { xfs_trans_cancel(args.trans, 0); + xfs_da_cleanup_name(&args, name); return(error); } = @@ -559,6 +580,7 @@ xfs_attr_remove_int(xfs_inode_t *dp, con xfs_ichgtime(dp, XFS_ICHGTIME_CHG); } = + xfs_da_cleanup_name(&args, name); return(error); = out: @@ -566,6 +588,7 @@ out: xfs_trans_cancel(args.trans, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT); xfs_iunlock(dp, XFS_ILOCK_EXCL); + xfs_da_cleanup_name(&args, name); return(error); } = @@ -634,7 +657,7 @@ xfs_attr_list_int(xfs_attr_list_context_ */ /*ARGSUSED*/ STATIC int -xfs_attr_put_listent(xfs_attr_list_context_t *context, attrnames_t *nam= esp, +xfs_attr_user_list(xfs_attr_list_context_t *context, attrnames_t *names= p, char *name, int namelen, int valuelen, char *value) { @@ -765,7 +788,7 @@ xfs_attr_list( context.alist->al_count =3D 0; context.alist->al_more =3D 0; context.alist->al_offset[0] =3D context.bufsize; - context.put_listent =3D xfs_attr_put_listent; + context.put_listent =3D xfs_attr_user_list; } = if (XFS_FORCED_SHUTDOWN(dp->i_mount)) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_attr_leaf.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_attr_leaf.c 2008-01-18 15:31:24.000000000 +1100 +++ b/fs/xfs/xfs_attr_leaf.c 2008-01-18 13:25:11.873394723 +1100 @@ -42,6 +42,7 @@ #include "xfs_attr.h" #include "xfs_attr_leaf.h" #include "xfs_error.h" +#include "xfs_unicode.h" = /* * xfs_attr_leaf.c @@ -90,6 +91,10 @@ STATIC void xfs_attr_leaf_moveents(xfs_a xfs_mount_t *mp); STATIC int xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index)= ; = +STATIC int xfs_attr_put_listent(xfs_attr_list_context_t *context, + attrnames_t *namesp, char *name, + int namelen, int valuelen, char *value); + /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D * Namespace helper routines *=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D*/ @@ -135,6 +140,38 @@ xfs_attr_namesp_match_overrides(int arg_ * External routines when attribute fork size < XFS_LITINO(mp). *=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D*/ = +STATIC xfs_attr_sf_entry_t * +xfs_attr_shortform_find_ent(xfs_da_args_t *args) +{ + xfs_attr_shortform_t *sf; + xfs_attr_sf_entry_t *sfe; + int i; + xfs_attr_sf_entry_t *ci_sfe =3D NULL; + + ASSERT(args->dp->i_afp->if_flags & XFS_IFINLINE); + sf =3D (xfs_attr_shortform_t *)args->dp->i_afp->if_u1.if_data; + sfe =3D &sf->list[0]; + + args->cmpresult =3D XFS_CMP_DIFFERENT; + for (i =3D 0; i < sf->hdr.count; sfe =3D XFS_ATTR_SF_NEXTENTRY(sfe), i= ++) { + if (!xfs_attr_namesp_match(args->flags, sfe->flags)) + continue; + switch (xfs_attr_compname(args->dp, sfe->nameval, sfe->namelen, + args->name, args->namelen)) { + case XFS_CMP_EXACT: + args->cmpresult =3D XFS_CMP_EXACT; + return sfe; + case XFS_CMP_CASE: + if (!ci_sfe) { + args->cmpresult =3D XFS_CMP_CASE; + ci_sfe =3D sfe; + } + default:; + } + } + return ci_sfe; +} + /* * Query whether the requested number of additional bytes of extended * attribute space will be able to fit inline. @@ -295,13 +332,10 @@ xfs_attr_shortform_add(xfs_da_args_t *ar sfe =3D &sf->list[0]; for (i =3D 0; i < sf->hdr.count; sfe =3D XFS_ATTR_SF_NEXTENTRY(sfe), i= ++) { #ifdef DEBUG - if (sfe->namelen !=3D args->namelen) - continue; - if (memcmp(args->name, sfe->nameval, args->namelen) !=3D 0) - continue; if (!xfs_attr_namesp_match(args->flags, sfe->flags)) continue; - ASSERT(0); + ASSERT(xfs_attr_compname(args->dp, args->name, args->namelen, + sfe->nameval, sfe->namelen) =3D=3D XFS_CMP_DIFFERENT); #endif } = @@ -331,29 +365,19 @@ xfs_attr_shortform_remove(xfs_da_args_t = { xfs_attr_shortform_t *sf; xfs_attr_sf_entry_t *sfe; - int base, size=3D0, end, totsize, i; + int base, size, end, totsize; xfs_mount_t *mp; xfs_inode_t *dp; = + sfe =3D xfs_attr_shortform_find_ent(args); + if (!sfe) + return XFS_ERROR(ENOATTR); + dp =3D args->dp; mp =3D dp->i_mount; - base =3D sizeof(xfs_attr_sf_hdr_t); sf =3D (xfs_attr_shortform_t *)dp->i_afp->if_u1.if_data; - sfe =3D &sf->list[0]; - end =3D sf->hdr.count; - for (i =3D 0; i < end; sfe =3D XFS_ATTR_SF_NEXTENTRY(sfe), - base +=3D size, i++) { size =3D XFS_ATTR_SF_ENTSIZE(sfe); - if (sfe->namelen !=3D args->namelen) - continue; - if (memcmp(sfe->nameval, args->name, args->namelen) !=3D 0) - continue; - if (!xfs_attr_namesp_match(args->flags, sfe->flags)) - continue; - break; - } - if (i =3D=3D end) - return(XFS_ERROR(ENOATTR)); + base =3D (int)((char *)sfe - (char *)sf); = /* * Fix up the attribute fork data, covering the hole @@ -412,26 +436,7 @@ xfs_attr_shortform_remove(xfs_da_args_t = int xfs_attr_shortform_lookup(xfs_da_args_t *args) { - xfs_attr_shortform_t *sf; - xfs_attr_sf_entry_t *sfe; - int i; - xfs_ifork_t *ifp; - - ifp =3D args->dp->i_afp; - ASSERT(ifp->if_flags & XFS_IFINLINE); - sf =3D (xfs_attr_shortform_t *)ifp->if_u1.if_data; - sfe =3D &sf->list[0]; - for (i =3D 0; i < sf->hdr.count; - sfe =3D XFS_ATTR_SF_NEXTENTRY(sfe), i++) { - if (sfe->namelen !=3D args->namelen) - continue; - if (memcmp(args->name, sfe->nameval, args->namelen) !=3D 0) - continue; - if (!xfs_attr_namesp_match(args->flags, sfe->flags)) - continue; - return(XFS_ERROR(EEXIST)); - } - return(XFS_ERROR(ENOATTR)); + return XFS_ERROR(xfs_attr_shortform_find_ent(args) ? EEXIST : ENOATTR)= ; } = /* @@ -441,35 +446,24 @@ xfs_attr_shortform_lookup(xfs_da_args_t = int xfs_attr_shortform_getvalue(xfs_da_args_t *args) { - xfs_attr_shortform_t *sf; xfs_attr_sf_entry_t *sfe; - int i; = - ASSERT(args->dp->i_d.di_aformat =3D=3D XFS_IFINLINE); - sf =3D (xfs_attr_shortform_t *)args->dp->i_afp->if_u1.if_data; - sfe =3D &sf->list[0]; - for (i =3D 0; i < sf->hdr.count; - sfe =3D XFS_ATTR_SF_NEXTENTRY(sfe), i++) { - if (sfe->namelen !=3D args->namelen) - continue; - if (memcmp(args->name, sfe->nameval, args->namelen) !=3D 0) - continue; - if (!xfs_attr_namesp_match(args->flags, sfe->flags)) - continue; + sfe =3D xfs_attr_shortform_find_ent(args); + if (!sfe) + return XFS_ERROR(ENOATTR); + if (args->flags & ATTR_KERNOVAL) { args->valuelen =3D sfe->valuelen; - return(XFS_ERROR(EEXIST)); + return XFS_ERROR(EEXIST); } if (args->valuelen < sfe->valuelen) { args->valuelen =3D sfe->valuelen; - return(XFS_ERROR(ERANGE)); + return XFS_ERROR(ERANGE); } args->valuelen =3D sfe->valuelen; - memcpy(args->value, &sfe->nameval[args->namelen], - args->valuelen); - return(XFS_ERROR(EEXIST)); - } - return(XFS_ERROR(ENOATTR)); + memcpy(args->value, &sfe->nameval[args->namelen], args->valuelen); + + return XFS_ERROR(EEXIST); } = /* @@ -535,17 +529,18 @@ xfs_attr_shortform_to_leaf(xfs_da_args_t = sfe =3D &sf->list[0]; for (i =3D 0; i < sf->hdr.count; i++) { - nargs.name =3D (char *)sfe->nameval; - nargs.namelen =3D sfe->namelen; - nargs.value =3D (char *)&sfe->nameval[nargs.namelen]; + nargs.value =3D (char *)&sfe->nameval[sfe->namelen]; nargs.valuelen =3D sfe->valuelen; - nargs.hashval =3D xfs_da_hashname((char *)sfe->nameval, + error =3D xfs_da_setup_name_and_hash(&nargs, sfe->nameval, sfe->namelen); + if (error) + goto out; nargs.flags =3D XFS_ATTR_NSP_ONDISK_TO_ARGS(sfe->flags); error =3D xfs_attr_leaf_lookup_int(bp, &nargs); /* set a->index */ ASSERT(error =3D=3D ENOATTR); error =3D xfs_attr_leaf_add(bp, &nargs); ASSERT(error !=3D ENOSPC); + xfs_da_cleanup_name(&nargs, sfe->nameval); if (error) goto out; sfe =3D XFS_ATTR_SF_NEXTENTRY(sfe); @@ -631,7 +626,7 @@ xfs_attr_shortform_list(xfs_attr_list_co continue; } namesp =3D xfs_attr_flags_namesp(sfe->flags); - error =3D context->put_listent(context, + error =3D xfs_attr_put_listent(context, namesp, (char *)sfe->nameval, (int)sfe->namelen, @@ -734,7 +729,7 @@ xfs_attr_shortform_list(xfs_attr_list_co cursor->hashval =3D sbp->hash; cursor->offset =3D 0; } - error =3D context->put_listent(context, + error =3D xfs_attr_put_listent(context, namesp, sbp->name, sbp->namelen, @@ -1960,6 +1955,7 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp xfs_attr_leaf_name_remote_t *name_rmt; int probe, span; xfs_dahash_t hashval; + xfs_dacmp_t cmp; = leaf =3D bp->data; ASSERT(be16_to_cpu(leaf->hdr.info.magic) =3D=3D XFS_ATTR_LEAF_MAGIC); @@ -2008,6 +2004,7 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp /* * Duplicate keys may be present, so search all of them for a match. */ + args->cmpresult =3D XFS_CMP_DIFFERENT; for ( ; (probe < be16_to_cpu(leaf->hdr.count)) && (be32_to_cpu(entry->hashval) =3D=3D hashval); entry++, probe++) { @@ -2019,35 +2016,40 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp * If we are looking for complete entries, show only those. */ if ((args->flags & XFS_ATTR_INCOMPLETE) !=3D - (entry->flags & XFS_ATTR_INCOMPLETE)) { - continue; - } - if (entry->flags & XFS_ATTR_LOCAL) { - name_loc =3D XFS_ATTR_LEAF_NAME_LOCAL(leaf, probe); - if (name_loc->namelen !=3D args->namelen) - continue; - if (memcmp(args->name, (char *)name_loc->nameval, args->namelen) !=3D= 0) + (entry->flags & XFS_ATTR_INCOMPLETE)) continue; if (!xfs_attr_namesp_match(args->flags, entry->flags)) continue; + if (entry->flags & XFS_ATTR_LOCAL) { + name_loc =3D XFS_ATTR_LEAF_NAME_LOCAL(leaf, probe); + cmp =3D xfs_attr_compname(args->dp, args->name, args->namelen, + name_loc->nameval, name_loc->namelen); + if (cmp !=3D XFS_CMP_DIFFERENT && cmp !=3D args->cmpresult) { + args->cmpresult =3D cmp; args->index =3D probe; - return(XFS_ERROR(EEXIST)); + args->rmtblkno =3D 0; + args->rmtblkcnt =3D 0; + if (cmp =3D=3D XFS_CMP_EXACT) + return XFS_ERROR(EEXIST); + } } else { name_rmt =3D XFS_ATTR_LEAF_NAME_REMOTE(leaf, probe); - if (name_rmt->namelen !=3D args->namelen) - continue; - if (memcmp(args->name, (char *)name_rmt->name, - args->namelen) !=3D 0) - continue; - if (!xfs_attr_namesp_match(args->flags, entry->flags)) - continue; + cmp =3D xfs_attr_compname(args->dp, args->name, args->namelen, + name_rmt->name, name_rmt->namelen); + if (cmp !=3D XFS_CMP_DIFFERENT && cmp !=3D args->cmpresult) { + args->cmpresult =3D cmp; args->index =3D probe; args->rmtblkno =3D be32_to_cpu(name_rmt->valueblk); args->rmtblkcnt =3D XFS_B_TO_FSB(args->dp->i_mount, be32_to_cpu(name_rmt->valuelen)); - return(XFS_ERROR(EEXIST)); + if (cmp =3D=3D XFS_CMP_EXACT) + return XFS_ERROR(EEXIST); + } } } + if (args->cmpresult =3D=3D XFS_CMP_CASE) + return XFS_ERROR(EEXIST); + args->index =3D probe; return(XFS_ERROR(ENOATTR)); } @@ -2074,8 +2076,8 @@ xfs_attr_leaf_getvalue(xfs_dabuf_t *bp, = entry =3D &leaf->entries[args->index]; if (entry->flags & XFS_ATTR_LOCAL) { name_loc =3D XFS_ATTR_LEAF_NAME_LOCAL(leaf, args->index); - ASSERT(name_loc->namelen =3D=3D args->namelen); - ASSERT(memcmp(args->name, name_loc->nameval, args->namelen) =3D=3D 0)= ; + ASSERT(xfs_attr_compname(args->dp, args->name, args->namelen, + name_loc->nameval, name_loc->namelen) !=3D XFS_CMP_DIFFERENT); valuelen =3D be16_to_cpu(name_loc->valuelen); if (args->flags & ATTR_KERNOVAL) { args->valuelen =3D valuelen; @@ -2089,8 +2091,8 @@ xfs_attr_leaf_getvalue(xfs_dabuf_t *bp, = memcpy(args->value, &name_loc->nameval[args->namelen], valuelen); } else { name_rmt =3D XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index); - ASSERT(name_rmt->namelen =3D=3D args->namelen); - ASSERT(memcmp(args->name, name_rmt->name, args->namelen) =3D=3D 0); + ASSERT(xfs_attr_compname(args->dp, args->name, args->namelen, + name_rmt->nameval, name_rmt->namelen) !=3D XFS_CMP_DIFFERENT); valuelen =3D be32_to_cpu(name_rmt->valuelen); args->rmtblkno =3D be32_to_cpu(name_rmt->valueblk); args->rmtblkcnt =3D XFS_B_TO_FSB(args->dp->i_mount, valuelen); @@ -2418,7 +2420,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, = xfs_attr_leaf_name_local_t *name_loc =3D XFS_ATTR_LEAF_NAME_LOCAL(leaf, i); = - retval =3D context->put_listent(context, + retval =3D xfs_attr_put_listent(context, namesp, (char *)name_loc->nameval, (int)name_loc->namelen, @@ -2445,7 +2447,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, = retval =3D xfs_attr_rmtval_get(&args); if (retval) return retval; - retval =3D context->put_listent(context, + retval =3D xfs_attr_put_listent(context, namesp, (char *)name_rmt->name, (int)name_rmt->namelen, @@ -2454,7 +2456,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, = kmem_free(args.value, valuelen); } else { - retval =3D context->put_listent(context, + retval =3D xfs_attr_put_listent(context, namesp, (char *)name_rmt->name, (int)name_rmt->namelen, @@ -2472,6 +2474,31 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, = return(retval); } = +/* + * Do NLS name conversion if required for attribute name and call + * context's put_listent routine + */ + +STATIC int +xfs_attr_put_listent(xfs_attr_list_context_t *context, attrnames_t *nam= esp, + char *name, int namelen, int valuelen, char *value) +{ + xfs_mount_t *mp =3D context->dp->i_mount; + char *nls_name =3D NULL; + int rval; + + if (!mp->m_nls) + return context->put_listent(context, namesp, name, namelen, + valuelen, value); + + rval =3D xfs_unicode_to_nls(mp->m_nls, name, namelen, &nls_name); + if (rval < 0) + return -rval; + rval =3D context->put_listent(context, namesp, nls_name, rval, + valuelen, value); + xfs_free_unicode_nls_name(nls_name); + return rval; +} = /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D * Manage the INCOMPLETE flag in a leaf entry @@ -2522,8 +2549,8 @@ xfs_attr_leaf_clearflag(xfs_da_args_t *a name =3D (char *)name_rmt->name; } ASSERT(be32_to_cpu(entry->hashval) =3D=3D args->hashval); - ASSERT(namelen =3D=3D args->namelen); - ASSERT(memcmp(name, args->name, namelen) =3D=3D 0); + ASSERT(xfs_attr_compname(args->dp, args->name, args->namelen, + name, namelen) !=3D XFS_CMP_DIFFERENT); #endif /* DEBUG */ = entry->flags &=3D ~XFS_ATTR_INCOMPLETE; @@ -2674,8 +2701,8 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *a name2 =3D (char *)name_rmt->name; } ASSERT(be32_to_cpu(entry1->hashval) =3D=3D be32_to_cpu(entry2->hashval= )); - ASSERT(namelen1 =3D=3D namelen2); - ASSERT(memcmp(name1, name2, namelen1) =3D=3D 0); + ASSERT(xfs_attr_compname(args->dp, name1, namelen1, name2, namelen2) != =3D + XFS_CMP_DIFFERENT); #endif /* DEBUG */ = ASSERT(entry1->flags & XFS_ATTR_INCOMPLETE); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_attr_leaf.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_attr_leaf.h 2008-01-18 15:31:24.000000000 +1100 +++ b/fs/xfs/xfs_attr_leaf.h 2008-01-11 14:16:44.268796245 +1100 @@ -36,6 +36,7 @@ struct xfs_da_args; struct xfs_da_state; struct xfs_da_state_blk; struct xfs_inode; +struct xfs_mount; struct xfs_trans; = /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D @@ -204,6 +205,16 @@ static inline int xfs_attr_leaf_entsize_ return (((bsize) >> 1) + ((bsize) >> 2)); } = +/* + * Do hash and name compare based on nameops + */ +#define xfs_attr_hashname(dp, n, l) \ + ((dp)->i_mount->m_attrnameops->hashname((dp), (n), (l))) + +#define xfs_attr_compname(dp, n1, l1, n2, l2) \ + ((dp)->i_mount->m_attrnameops->compname((dp), (n1), (l1), \ + (n2), (l2))) + = /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D * Structure used to pass context around among the routines. @@ -296,6 +307,7 @@ int xfs_attr_root_inactive(struct xfs_tr /* * Utility routines. */ +void xfs_attr_mount(struct xfs_mount *mp); xfs_dahash_t xfs_attr_leaf_lasthash(struct xfs_dabuf *bp, int *count); int xfs_attr_leaf_order(struct xfs_dabuf *leaf1_bp, struct xfs_dabuf *leaf2_bp); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_clnt.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_clnt.h 2008-01-18 15:31:24.000000000 +1100 +++ b/fs/xfs/xfs_clnt.h 2007-11-01 13:16:55.000383139 +1100 @@ -48,6 +48,7 @@ struct xfs_mount_args { char rtname[MAXNAMELEN+1]; /* realtime device filename */ char logname[MAXNAMELEN+1]; /* journal device filename */ char mtpt[MAXNAMELEN+1]; /* filesystem mount point */ + char nls[MAXNAMELEN+1]; /* NLS code page to use */ int sunit; /* stripe unit (BBs) */ int swidth; /* stripe width (BBs), multiple of sunit */ uchar_t iosizelog; /* log2 of the preferred I/O size */ @@ -100,5 +101,9 @@ struct xfs_mount_args { * I/O size in stat(2) */ #define XFSMNT2_FILESTREAMS 0x00000002 /* enable the filestreams * allocator */ +#define XFSMNT2_CILOOKUP 0x00000004 /* enable case-insensitive + * filename lookup */ +#define XFSMNT2_CIATTR 0x00000008 /* enable case-insensitive + * extended attr names */ = #endif /* __XFS_CLNT_H__ */ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_da_btree.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_da_btree.c 2008-01-18 15:31:24.000000000 +1100 +++ b/fs/xfs/xfs_da_btree.c 2007-10-31 16:04:16.463309546 +1100 @@ -46,6 +46,7 @@ #include "xfs_dir2_block.h" #include "xfs_dir2_node.h" #include "xfs_error.h" +#include "xfs_unicode.h" = /* * xfs_da_btree.c @@ -1530,6 +1531,100 @@ xfs_da_hashname(const uchar_t *name, int } } = + +static xfs_dahash_t +xfs_default_hashname(xfs_inode_t *inode, const uchar_t *name, int namel= en) +{ + return xfs_da_hashname(name, namelen); +} + +xfs_dacmp_t +xfs_default_compname(xfs_inode_t *inode, const uchar_t *name1, int len1= , + const uchar_t *name2, int len2) +{ + return (len1 =3D=3D len2 && memcmp(name1, name2, len1) =3D=3D 0) ? + XFS_CMP_EXACT : XFS_CMP_DIFFERENT; +} + +static xfs_dahash_t +xfs_unicode_ci_hashname( + xfs_inode_t *inode, + const uchar_t *name, + int namelen) +{ + return xfs_unicode_hash(inode->i_mount->m_cft, name, namelen); +} + +static xfs_dacmp_t +xfs_unicode_ci_compname( + xfs_inode_t *inode, + const uchar_t *name1, + int len1, + const uchar_t *name2, + int len2) +{ + if (len1 =3D=3D len2 && memcmp(name1, name2, len1) =3D=3D 0) + return XFS_CMP_EXACT; + + return xfs_unicode_casecmp(inode->i_mount->m_cft, name1, len1, + name2, len2) =3D=3D 0 ? XFS_CMP_CASE : XFS_CMP_DIFFERENT; +} + +const struct xfs_nameops xfs_default_nameops =3D { + .hashname =3D xfs_default_hashname, + .compname =3D xfs_default_compname +}; + +const struct xfs_nameops xfs_unicode_nameops =3D { + .hashname =3D xfs_unicode_ci_hashname, + .compname =3D xfs_default_compname, +}; + +const struct xfs_nameops xfs_unicode_ci_nameops =3D { + .hashname =3D xfs_unicode_ci_hashname, + .compname =3D xfs_unicode_ci_compname, +}; + +int +xfs_da_setup_name_and_hash( + xfs_da_args_t *args, + const char *name, + int namelen) +{ + xfs_mount_t *mp =3D args->dp->i_mount; + + if (mp->m_nls) { + args->name =3D NULL; + args->namelen =3D xfs_nls_to_unicode(mp->m_nls, name, namelen, + (char **)&args->name); + if (args->namelen < 0) + return -args->namelen; + } else { + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + int rval; + rval =3D xfs_unicode_validate(name, namelen); + if (rval < 0) + return -rval; + } + args->name =3D name; + args->namelen =3D namelen; + } + args->hashval =3D (args->whichfork =3D=3D XFS_ATTR_FORK) ? + xfs_attr_hashname(args->dp, args->name, args->namelen) : + xfs_dir_hashname(args->dp, args->name, args->namelen); + return 0; +} + +void +xfs_da_cleanup_name( + xfs_da_args_t *args, + const char *name) +{ + if ((char *)args->name !=3D name) + xfs_free_unicode_nls_name((char *)args->name); +} + + /* * Add a block to the btree ahead of the file. * Return the new block number to the caller. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_da_btree.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_da_btree.h 2008-01-18 15:31:24.000000000 +1100 +++ b/fs/xfs/xfs_da_btree.h 2008-01-14 12:12:32.917055949 +1100 @@ -99,6 +99,15 @@ typedef struct xfs_da_node_entry xfs_da_ *=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D*/ = /* + * Search comparison results + */ +typedef enum { + XFS_CMP_DIFFERENT, /* names are completely different */ + XFS_CMP_EXACT, /* names are exactly the same */ + XFS_CMP_CASE /* names are same but differ in case */ +} xfs_dacmp_t; + +/* * Structure to ease passing around component names. */ typedef struct xfs_da_args { @@ -127,6 +136,7 @@ typedef struct xfs_da_args { unsigned char rename; /* T/F: this is an atomic rename op */ unsigned char addname; /* T/F: this is an add operation */ unsigned char oknoent; /* T/F: ok to return ENOENT, else die */ + xfs_dacmp_t cmpresult; /* name compare result for lookups */ } xfs_da_args_t; = /* @@ -201,12 +211,37 @@ typedef struct xfs_da_state { (uint)(XFS_DA_LOGOFF(BASE, ADDR)), \ (uint)(XFS_DA_LOGOFF(BASE, ADDR)+(SIZE)-1) = +/* + * Name ops for directory and/or attr name operations + */ + +typedef xfs_dahash_t (*xfs_hashname_t)(struct xfs_inode *, const uchar_= t *, + int); +typedef xfs_dacmp_t (*xfs_compname_t)(struct xfs_inode *, const uchar_t= *, + int, const uchar_t *, int); + +typedef struct xfs_nameops { + xfs_hashname_t hashname; + xfs_compname_t compname; +} xfs_nameops_t; + = #ifdef __KERNEL__ /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D * Function prototypes for the kernel. *=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D*/ = +extern const struct xfs_nameops xfs_default_nameops; +extern const struct xfs_nameops xfs_unicode_nameops; +extern const struct xfs_nameops xfs_unicode_ci_nameops; + +xfs_dacmp_t xfs_default_compname(struct xfs_inode *inode, const uchar_t= *name1, + int len1, const uchar_t *name2, int len2); + +int xfs_da_setup_name_and_hash(xfs_da_args_t *args, const char *name, + int namelen); +void xfs_da_cleanup_name(xfs_da_args_t *args, const char *name); + /* * Routines used for growing the Btree. */ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_dir2.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_dir2.c 2008-01-18 15:31:24.000000000 +1100 +++ b/fs/xfs/xfs_dir2.c 2008-01-11 14:24:51.701973714 +1100 @@ -42,8 +42,56 @@ #include "xfs_dir2_node.h" #include "xfs_dir2_trace.h" #include "xfs_error.h" +#include "xfs_unicode.h" #include "xfs_vnodeops.h" = +/* + * V1 case-insensitive support for directories + */ +static xfs_dahash_t +xfs_ascii_ci_hashname( + xfs_inode_t *inode, + const uchar_t *name, + int namelen) +{ + xfs_dahash_t hash; + int i; + + for (i =3D 0, hash =3D 0; i < namelen; i++) + hash =3D tolower(name[i]) ^ rol32(hash, 7); + + return hash; +} + +static xfs_dacmp_t +xfs_ascii_ci_compname( + xfs_inode_t *inode, + const uchar_t *name1, + int len1, + const uchar_t *name2, + int len2) +{ + xfs_dacmp_t result =3D XFS_CMP_EXACT; + int i; + + if (len1 !=3D len2) + return XFS_CMP_DIFFERENT; + + for (i =3D 0; i < len1; i++) { + if (name1[i] =3D=3D name2[i]) + continue; + if (tolower(name1[i]) !=3D tolower(name2[i])) + return XFS_CMP_DIFFERENT; + result =3D XFS_CMP_CASE; + } + + return result; +} + +static const struct xfs_nameops xfs_ascii_ci_nameops =3D { + .hashname =3D xfs_ascii_ci_hashname, + .compname =3D xfs_ascii_ci_compname, +}; = void xfs_dir_mount( @@ -64,6 +112,13 @@ xfs_dir_mount( (mp->m_dirblksize - (uint)sizeof(xfs_da_node_hdr_t)) / (uint)sizeof(xfs_da_node_entry_t); mp->m_dir_magicpct =3D (mp->m_dirblksize * 37) / 100; + + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + mp->m_dirnameops =3D (mp->m_flags & XFS_MOUNT_CI_LOOKUP) ? + &xfs_unicode_ci_nameops : &xfs_unicode_nameops; + } else + mp->m_dirnameops =3D (xfs_sb_version_hasoldci(&mp->m_sb)) ? + &xfs_ascii_ci_nameops : &xfs_default_nameops; } = /* @@ -140,7 +195,7 @@ xfs_dir_init( } = /* - Enter a name in a directory. + * Enter a name in a directory. */ int xfs_dir_createname( @@ -162,9 +217,6 @@ xfs_dir_createname( return rval; XFS_STATS_INC(xs_dir_create); = - args.name =3D name; - args.namelen =3D namelen; - args.hashval =3D xfs_da_hashname(name, namelen); args.inumber =3D inum; args.dp =3D dp; args.firstblock =3D first; @@ -174,32 +226,41 @@ xfs_dir_createname( args.trans =3D tp; args.justcheck =3D 0; args.addname =3D args.oknoent =3D 1; + rval =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (rval) + return rval; = if (dp->i_d.di_format =3D=3D XFS_DINODE_FMT_LOCAL) rval =3D xfs_dir2_sf_addname(&args); else if ((rval =3D xfs_dir2_isblock(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_block_addname(&args); else if ((rval =3D xfs_dir2_isleaf(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_leaf_addname(&args); else rval =3D xfs_dir2_node_addname(&args); +out: + xfs_da_cleanup_name(&args, name); return rval; } = /* - * Lookup a name in a directory, give back the inode number. + * Lookup a name in a directory, give back the inode number and also + * actual name if case-insensitive match. */ + int xfs_dir_lookup( xfs_trans_t *tp, xfs_inode_t *dp, char *name, int namelen, - xfs_ino_t *inum) /* out: inode number */ + xfs_ino_t *inum, /* out: inode number */ + char **actual_name, /* out: actual name if different */ + int *actual_namelen) { xfs_da_args_t args; int rval; @@ -208,9 +269,9 @@ xfs_dir_lookup( ASSERT((dp->i_d.di_mode & S_IFMT) =3D=3D S_IFDIR); XFS_STATS_INC(xs_dir_lookup); = - args.name =3D name; - args.namelen =3D namelen; - args.hashval =3D xfs_da_hashname(name, namelen); + if (actual_name) + *actual_name =3D NULL; + args.inumber =3D 0; args.dp =3D dp; args.firstblock =3D NULL; @@ -220,23 +281,39 @@ xfs_dir_lookup( args.trans =3D tp; args.justcheck =3D args.addname =3D 0; args.oknoent =3D 1; + args.value =3D NULL; /* value may contain actual name on return */ + args.valuelen =3D 0; + rval =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (rval) + return rval; = if (dp->i_d.di_format =3D=3D XFS_DINODE_FMT_LOCAL) rval =3D xfs_dir2_sf_lookup(&args); else if ((rval =3D xfs_dir2_isblock(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_block_lookup(&args); else if ((rval =3D xfs_dir2_isleaf(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_leaf_lookup(&args); else rval =3D xfs_dir2_node_lookup(&args); if (rval =3D=3D EEXIST) rval =3D 0; - if (rval =3D=3D 0) + if (rval =3D=3D 0) { *inum =3D args.inumber; + if (args.value) { + ASSERT(args->cmpresult =3D=3D XFS_CMP_CASE); + if (actual_name) { + *actual_namelen =3D args.valuelen, + *actual_name =3D args.value; + } else + xfs_free_unicode_nls_name(args.value); + } + } +out: + xfs_da_cleanup_name(&args, name); return rval; } = @@ -261,9 +338,6 @@ xfs_dir_removename( ASSERT((dp->i_d.di_mode & S_IFMT) =3D=3D S_IFDIR); XFS_STATS_INC(xs_dir_remove); = - args.name =3D name; - args.namelen =3D namelen; - args.hashval =3D xfs_da_hashname(name, namelen); args.inumber =3D ino; args.dp =3D dp; args.firstblock =3D first; @@ -272,19 +346,24 @@ xfs_dir_removename( args.whichfork =3D XFS_DATA_FORK; args.trans =3D tp; args.justcheck =3D args.addname =3D args.oknoent =3D 0; + rval =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (rval) + return rval; = if (dp->i_d.di_format =3D=3D XFS_DINODE_FMT_LOCAL) rval =3D xfs_dir2_sf_removename(&args); else if ((rval =3D xfs_dir2_isblock(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_block_removename(&args); else if ((rval =3D xfs_dir2_isleaf(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_leaf_removename(&args); else rval =3D xfs_dir2_node_removename(&args); +out: + xfs_da_cleanup_name(&args, name); return rval; } = @@ -345,9 +424,6 @@ xfs_dir_replace( if ((rval =3D xfs_dir_ino_validate(tp->t_mountp, inum))) return rval; = - args.name =3D name; - args.namelen =3D namelen; - args.hashval =3D xfs_da_hashname(name, namelen); args.inumber =3D inum; args.dp =3D dp; args.firstblock =3D first; @@ -356,19 +432,24 @@ xfs_dir_replace( args.whichfork =3D XFS_DATA_FORK; args.trans =3D tp; args.justcheck =3D args.addname =3D args.oknoent =3D 0; + rval =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (rval) + return rval; = if (dp->i_d.di_format =3D=3D XFS_DINODE_FMT_LOCAL) rval =3D xfs_dir2_sf_replace(&args); else if ((rval =3D xfs_dir2_isblock(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_block_replace(&args); else if ((rval =3D xfs_dir2_isleaf(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_leaf_replace(&args); else rval =3D xfs_dir2_node_replace(&args); +out: + xfs_da_cleanup_name(&args, name); return rval; } = @@ -388,9 +469,6 @@ xfs_dir_canenter( = ASSERT((dp->i_d.di_mode & S_IFMT) =3D=3D S_IFDIR); = - args.name =3D name; - args.namelen =3D namelen; - args.hashval =3D xfs_da_hashname(name, namelen); args.inumber =3D 0; args.dp =3D dp; args.firstblock =3D NULL; @@ -399,19 +477,24 @@ xfs_dir_canenter( args.whichfork =3D XFS_DATA_FORK; args.trans =3D tp; args.justcheck =3D args.addname =3D args.oknoent =3D 1; + rval =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (rval) + return rval; = if (dp->i_d.di_format =3D=3D XFS_DINODE_FMT_LOCAL) rval =3D xfs_dir2_sf_addname(&args); else if ((rval =3D xfs_dir2_isblock(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_block_addname(&args); else if ((rval =3D xfs_dir2_isleaf(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_leaf_addname(&args); else rval =3D xfs_dir2_node_addname(&args); +out: + xfs_da_cleanup_name(&args, name); return rval; } = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_dir2.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_dir2.h 2008-01-18 15:31:24.000000000 +1100 +++ b/fs/xfs/xfs_dir2.h 2007-11-01 13:11:00.206583735 +1100 @@ -72,7 +72,8 @@ extern int xfs_dir_createname(struct xfs xfs_fsblock_t *first, struct xfs_bmap_free *flist, xfs_extlen_t tot); extern int xfs_dir_lookup(struct xfs_trans *tp, struct xfs_inode *dp, - char *name, int namelen, xfs_ino_t *inum); + char *name, int namelen, xfs_ino_t *inum, + char **actual_name, int *actual_namelen); extern int xfs_dir_removename(struct xfs_trans *tp, struct xfs_inode *d= p, char *name, int namelen, xfs_ino_t ino, xfs_fsblock_t *first, @@ -85,6 +86,13 @@ extern int xfs_dir_canenter(struct xfs_t char *name, int namelen); extern int xfs_dir_ino_validate(struct xfs_mount *mp, xfs_ino_t ino); = +#define xfs_dir_hashname(dp, n, l) \ + ((dp)->i_mount->m_dirnameops->hashname((dp), (n), (l))) + +#define xfs_dir_compname(dp, n1, l1, n2, l2) \ + ((dp)->i_mount->m_dirnameops->compname((dp), (n1), (l1), \ + (n2), (l2))) + /* * Utility routines for v2 directories. */ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_dir2_block.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_dir2_block.c 2008-01-18 15:31:24.000000000 +1100 +++ b/fs/xfs/xfs_dir2_block.c 2008-01-11 14:28:44.763934272 +1100 @@ -38,6 +38,7 @@ #include "xfs_dir2_block.h" #include "xfs_dir2_trace.h" #include "xfs_error.h" +#include "xfs_unicode.h" = /* * Local function prototypes. @@ -450,6 +451,8 @@ xfs_dir2_block_getdents( int wantoff; /* starting block offset */ xfs_ino_t ino; xfs_off_t cook; + char *nls_name =3D NULL; /* NLS name buffer */ + int nls_namelen =3D 0; = mp =3D dp->i_mount; /* @@ -481,6 +484,9 @@ xfs_dir2_block_getdents( ptr =3D (char *)block->u; endptr =3D (char *)xfs_dir2_block_leaf_p(btp); = + if (mp->m_nls) + nls_name =3D xfs_alloc_unicode_nls_name(); + /* * Loop over the data portion of the block. * Each object is a real entry (dep) or an unused one (dup). @@ -513,15 +519,19 @@ xfs_dir2_block_getdents( #if XFS_BIG_INUMS ino +=3D mp->m_inoadd; #endif + if (mp->m_nls) + nls_namelen =3D xfs_unicode_to_nls(mp->m_nls, dep->name, + dep->namelen, &nls_name); = /* * If it didn't fit, set the final offset to here & return. */ - if (filldir(dirent, dep->name, dep->namelen, cook, - ino, DT_UNKNOWN)) { + if (filldir(dirent, + nls_namelen > 0 ? nls_name : (char *)dep->name, + nls_namelen > 0 ? nls_namelen : dep->namelen, + cook, ino, DT_UNKNOWN)) { *offset =3D cook; - xfs_da_brelse(NULL, bp); - return 0; + goto out; } } = @@ -530,6 +540,9 @@ xfs_dir2_block_getdents( * Set the offset to a non-existent block 1 and return. */ *offset =3D xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0); +out: + if (mp->m_nls) + xfs_free_unicode_nls_name(nls_name); xfs_da_brelse(NULL, bp); return 0; } @@ -616,6 +629,14 @@ xfs_dir2_block_lookup( * Fill in inode number, release the block. */ args->inumber =3D be64_to_cpu(dep->inumber); + if (args->cmpresult =3D=3D XFS_CMP_CASE) { + args->valuelen =3D xfs_unicode_to_nls(mp->m_nls, dep->name, + dep->namelen, (char **)&args->value); + if (args->valuelen < 0) { + xfs_da_brelse(args->trans, bp); + return XFS_ERROR(-args->valuelen); + } + } xfs_da_brelse(args->trans, bp); return XFS_ERROR(EEXIST); } @@ -643,6 +664,7 @@ xfs_dir2_block_lookup_int( int mid; /* binary search current idx */ xfs_mount_t *mp; /* filesystem mount point */ xfs_trans_t *tp; /* transaction pointer */ + xfs_dacmp_t cmp; /* comparison result */ = dp =3D args->dp; tp =3D args->trans; @@ -688,6 +710,7 @@ xfs_dir2_block_lookup_int( * Now loop forward through all the entries with the * right hash value looking for our name. */ + args->cmpresult =3D XFS_CMP_DIFFERENT; do { if ((addr =3D be32_to_cpu(blp[mid].address)) =3D=3D XFS_DIR2_NULL_DAT= APTR) continue; @@ -697,20 +720,34 @@ xfs_dir2_block_lookup_int( dep =3D (xfs_dir2_data_entry_t *) ((char *)block + xfs_dir2_dataptr_to_off(mp, addr)); /* - * Compare, if it's right give back buffer & entry number. - */ - if (dep->namelen =3D=3D args->namelen && - dep->name[0] =3D=3D args->name[0] && - memcmp(dep->name, args->name, args->namelen) =3D=3D 0) { + * Compare, if it's right give back buffer & entry number: + * + * lookup case - use nameops; + * + * replace/remove case - as lookup has been already been + * performed, look for an exact match using the fast method + */ + cmp =3D args->oknoent ? + xfs_dir_compname(dp, dep->name, dep->namelen, + args->name, args->namelen) : + xfs_default_compname(dp, dep->name, dep->namelen, + args->name, args->namelen); + if (cmp !=3D XFS_CMP_DIFFERENT && cmp !=3D args->cmpresult) { + args->cmpresult =3D cmp; *bpp =3D bp; *entno =3D mid; + if (cmp =3D=3D XFS_CMP_EXACT) return 0; } - } while (++mid < be32_to_cpu(btp->count) && be32_to_cpu(blp[mid].hashv= al) =3D=3D hash); + } while (++mid < be32_to_cpu(btp->count) && + be32_to_cpu(blp[mid].hashval) =3D=3D hash); + + ASSERT(args->oknoent); + if (args->cmpresult =3D=3D XFS_CMP_CASE) + return 0; /* * No match, release the buffer and return ENOENT. */ - ASSERT(args->oknoent); xfs_da_brelse(tp, bp); return XFS_ERROR(ENOENT); } @@ -1187,8 +1224,8 @@ xfs_dir2_sf_to_block( tagp =3D xfs_dir2_data_entry_tag_p(dep); *tagp =3D cpu_to_be16((char *)dep - (char *)block); xfs_dir2_data_log_entry(tp, bp, dep); - blp[2 + i].hashval =3D cpu_to_be32(xfs_da_hashname( - (char *)sfep->name, sfep->namelen)); + blp[2 + i].hashval =3D cpu_to_be32(xfs_dir_hashname(dp, + sfep->name, sfep->namelen)); blp[2 + i].address =3D cpu_to_be32(xfs_dir2_byte_to_dataptr(mp, (char *)dep - (char *)block)); offset =3D (int)((char *)(tagp + 1) - (char *)block); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_dir2_data.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_dir2_data.c 2008-01-18 15:31:24.000000000 +1100 +++ b/fs/xfs/xfs_dir2_data.c 2007-10-10 15:10:39.019079916 +1000 @@ -140,7 +140,8 @@ xfs_dir2_data_check( addr =3D xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk, (xfs_dir2_data_aoff_t) ((char *)dep - (char *)d)); - hash =3D xfs_da_hashname((char *)dep->name, dep->namelen); + hash =3D xfs_dir_hashname(dp, (char *)dep->name, + dep->namelen); for (i =3D 0; i < be32_to_cpu(btp->count); i++) { if (be32_to_cpu(lep[i].address) =3D=3D addr && be32_to_cpu(lep[i].hashval) =3D=3D hash) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_dir2_leaf.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_dir2_leaf.c 2008-01-18 15:31:24.000000000 +1100 +++ b/fs/xfs/xfs_dir2_leaf.c 2008-01-17 17:06:07.795121260 +1100 @@ -40,6 +40,7 @@ #include "xfs_dir2_node.h" #include "xfs_dir2_trace.h" #include "xfs_error.h" +#include "xfs_unicode.h" = /* * Local function declarations. @@ -780,6 +781,8 @@ xfs_dir2_leaf_getdents( int ra_offset; /* map entry offset for ra */ int ra_want; /* readahead count wanted */ xfs_ino_t ino; + char *nls_name =3D NULL; /* NLS name buffer */ + int nls_namelen =3D 0; = /* * If the offset is at or past the largest allowed value, @@ -800,6 +803,9 @@ xfs_dir2_leaf_getdents( map_valid =3D ra_index =3D ra_offset =3D ra_current =3D map_blocks =3D= 0; bp =3D NULL; = + if (mp->m_nls) + nls_name =3D xfs_alloc_unicode_nls_name(); + /* * Inside the loop we keep the main offset value as a byte offset * in the directory file. @@ -1086,11 +1092,16 @@ xfs_dir2_leaf_getdents( #if XFS_BIG_INUMS ino +=3D mp->m_inoadd; #endif + if (mp->m_nls) + nls_namelen =3D xfs_unicode_to_nls(mp->m_nls, dep->name, + dep->namelen, &nls_name); = /* * Won't fit. Return to caller. */ - if (filldir(dirent, dep->name, dep->namelen, + if (filldir(dirent, + nls_namelen > 0 ? nls_name : (char *)dep->name, + nls_namelen > 0 ? nls_namelen : dep->namelen, xfs_dir2_byte_to_dataptr(mp, curoff), ino, DT_UNKNOWN)) break; @@ -1113,6 +1124,8 @@ xfs_dir2_leaf_getdents( kmem_free(map, map_size * sizeof(*map)); if (bp) xfs_da_brelse(NULL, bp); + if (mp->m_nls) + xfs_free_unicode_nls_name(nls_name); return error; } = @@ -1300,10 +1313,17 @@ xfs_dir2_leaf_lookup( /* * Return the found inode number. */ + error =3D EEXIST; args->inumber =3D be64_to_cpu(dep->inumber); + if (args->cmpresult =3D=3D XFS_CMP_CASE) { + args->valuelen =3D xfs_unicode_to_nls(args->dp->i_mount->m_nls, + dep->name, dep->namelen, (char **)&args->value); + if (args->valuelen < 0) + error =3D -args->valuelen; + } xfs_da_brelse(tp, dbp); xfs_da_brelse(tp, lbp); - return XFS_ERROR(EEXIST); + return XFS_ERROR(error); } = /* @@ -1331,6 +1351,7 @@ xfs_dir2_leaf_lookup_int( xfs_mount_t *mp; /* filesystem mount point */ xfs_dir2_db_t newdb; /* new data block number */ xfs_trans_t *tp; /* transaction pointer */ + xfs_dacmp_t cmp; /* name compare result */ = dp =3D args->dp; tp =3D args->trans; @@ -1354,6 +1375,7 @@ xfs_dir2_leaf_lookup_int( * Loop over all the entries with the right hash value * looking to match the name. */ + args->cmpresult =3D XFS_CMP_DIFFERENT; for (lep =3D &leaf->ents[index], dbp =3D NULL, curdb =3D -1; index < be16_to_cpu(leaf->hdr.count) && be32_to_cpu(lep->hashval)= =3D=3D args->hashval; lep++, index++) { @@ -1391,19 +1413,31 @@ xfs_dir2_leaf_lookup_int( xfs_dir2_dataptr_to_off(mp, be32_to_cpu(lep->address))); /* * If it matches then return it. - */ - if (dep->namelen =3D=3D args->namelen && - dep->name[0] =3D=3D args->name[0] && - memcmp(dep->name, args->name, args->namelen) =3D=3D 0) { + * + * lookup case - use nameops; + * + * replace/remove case - as lookup has been already been + * performed, look for an exact match using the fast method + */ + cmp =3D args->oknoent ? + xfs_dir_compname(dp, dep->name, dep->namelen, + args->name, args->namelen) : + xfs_default_compname(dp, dep->name, dep->namelen, + args->name, args->namelen); + if (cmp !=3D XFS_CMP_DIFFERENT && cmp !=3D args->cmpresult) { + args->cmpresult =3D cmp; *dbpp =3D dbp; *indexp =3D index; + if (cmp =3D=3D XFS_CMP_EXACT) return 0; } } + ASSERT(args->oknoent); + if (args->cmpresult =3D=3D XFS_CMP_CASE) + return 0; /* * No match found, return ENOENT. */ - ASSERT(args->oknoent); if (dbp) xfs_da_brelse(tp, dbp); xfs_da_brelse(tp, lbp); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_dir2_node.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_dir2_node.c 2008-01-18 15:31:25.000000000 +1100 +++ b/fs/xfs/xfs_dir2_node.c 2007-10-31 12:32:04.060201390 +1100 @@ -39,6 +39,7 @@ #include "xfs_dir2_node.h" #include "xfs_dir2_trace.h" #include "xfs_error.h" +#include "xfs_unicode.h" = /* * Function declarations. @@ -414,6 +415,7 @@ xfs_dir2_leafn_lookup_int( xfs_dir2_db_t newdb; /* new data block number */ xfs_dir2_db_t newfdb; /* new free block number */ xfs_trans_t *tp; /* transaction pointer */ + xfs_dacmp_t cmp; /* comparison result */ = dp =3D args->dp; tp =3D args->trans; @@ -455,6 +457,7 @@ xfs_dir2_leafn_lookup_int( /* * Loop over leaf entries with the right hash value. */ + args->cmpresult =3D XFS_CMP_DIFFERENT; for (lep =3D &leaf->ents[index]; index < be16_to_cpu(leaf->hdr.count) && be32_to_cpu(lep->hashval)= =3D=3D args->hashval; lep++, index++) { @@ -572,28 +575,34 @@ xfs_dir2_leafn_lookup_int( /* * Point to the data entry. */ - dep =3D (xfs_dir2_data_entry_t *) - ((char *)curbp->data + + dep =3D (xfs_dir2_data_entry_t *)((char *)curbp->data + xfs_dir2_dataptr_to_off(mp, be32_to_cpu(lep->address))); /* * Compare the entry, return it if it matches. */ - if (dep->namelen =3D=3D args->namelen && - dep->name[0] =3D=3D args->name[0] && - memcmp(dep->name, args->name, args->namelen) =3D=3D 0) { + cmp =3D args->oknoent ? + xfs_dir_compname(dp, dep->name, dep->namelen, + args->name, args->namelen): + xfs_default_compname(dp, dep->name, dep->namelen, + args->name, args->namelen); + if (cmp !=3D XFS_CMP_DIFFERENT && + cmp !=3D args->cmpresult) { + args->cmpresult =3D cmp; args->inumber =3D be64_to_cpu(dep->inumber); *indexp =3D index; state->extravalid =3D 1; state->extrablk.bp =3D curbp; state->extrablk.blkno =3D curdb; - state->extrablk.index =3D - (int)((char *)dep - + state->extrablk.index =3D (int)((char *)dep - (char *)curbp->data); state->extrablk.magic =3D XFS_DIR2_DATA_MAGIC; + if (cmp =3D=3D XFS_CMP_EXACT) return XFS_ERROR(EEXIST); } } } + if (args->cmpresult =3D=3D XFS_CMP_CASE) + return XFS_ERROR(EEXIST); /* * Didn't find a match. * If we are holding a buffer, give it back in case our caller @@ -1768,6 +1777,19 @@ xfs_dir2_node_lookup( if (error) rval =3D error; /* + * If case-insens match, copy name out + */ + if (args->cmpresult =3D=3D XFS_CMP_CASE) { + xfs_dir2_data_entry_t *dep =3D + (xfs_dir2_data_entry_t *) + ((char *)state->extrablk.bp->data + + state->extrablk.index); + args->valuelen =3D xfs_unicode_to_nls(args->dp->i_mount->m_nls, + dep->name, dep->namelen, (char **)&args->value); + if (args->valuelen < 0) + rval =3D -args->valuelen; + } + /* * Release the btree blocks and leaf block. */ for (i =3D 0; i < state->path.active; i++) { =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_dir2_sf.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_dir2_sf.c 2008-01-18 15:31:25.000000000 +1100 +++ b/fs/xfs/xfs_dir2_sf.c 2008-01-17 12:25:01.552398622 +1100 @@ -38,6 +38,7 @@ #include "xfs_dir2_leaf.h" #include "xfs_dir2_block.h" #include "xfs_dir2_trace.h" +#include "xfs_unicode.h" = /* * Prototypes for internal functions. @@ -708,6 +709,8 @@ xfs_dir2_sf_getdents( xfs_dir2_dataptr_t dot_offset; xfs_dir2_dataptr_t dotdot_offset; xfs_ino_t ino; + char *nls_name =3D NULL; /* NLS name buffer */ + int nls_namelen =3D 0; = mp =3D dp->i_mount; = @@ -772,6 +775,9 @@ xfs_dir2_sf_getdents( } } = + if (mp->m_nls) + nls_name =3D xfs_alloc_unicode_nls_name(); + /* * Loop while there are more entries and put'ing works. */ @@ -789,16 +795,22 @@ xfs_dir2_sf_getdents( #if XFS_BIG_INUMS ino +=3D mp->m_inoadd; #endif - - if (filldir(dirent, sfep->name, sfep->namelen, + if (mp->m_nls) + nls_namelen =3D xfs_unicode_to_nls(mp->m_nls, sfep->name, + sfep->namelen, &nls_name); + if (filldir(dirent, + nls_namelen > 0 ? nls_name : (char *)sfep->name, + nls_namelen > 0 ? nls_namelen : sfep->namelen, off, ino, DT_UNKNOWN)) { *offset =3D off; - return 0; + goto out; } sfep =3D xfs_dir2_sf_nextentry(sfp, sfep); } - *offset =3D xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0); +out: + if (mp->m_nls) + xfs_free_unicode_nls_name(nls_name); return 0; } = @@ -836,6 +848,7 @@ xfs_dir2_sf_lookup( */ if (args->namelen =3D=3D 1 && args->name[0] =3D=3D '.') { args->inumber =3D dp->i_ino; + args->cmpresult =3D XFS_CMP_EXACT; return XFS_ERROR(EEXIST); } /* @@ -844,23 +857,43 @@ xfs_dir2_sf_lookup( if (args->namelen =3D=3D 2 && args->name[0] =3D=3D '.' && args->name[1] =3D=3D '.') { args->inumber =3D xfs_dir2_sf_get_inumber(sfp, &sfp->hdr.parent); + args->cmpresult =3D XFS_CMP_EXACT; return XFS_ERROR(EEXIST); } /* * Loop over all the entries trying to match ours. */ - for (i =3D 0, sfep =3D xfs_dir2_sf_firstentry(sfp); - i < sfp->hdr.count; + args->cmpresult =3D XFS_CMP_DIFFERENT; + for (i =3D 0, sfep =3D xfs_dir2_sf_firstentry(sfp); i < sfp->hdr.count= ; i++, sfep =3D xfs_dir2_sf_nextentry(sfp, sfep)) { - if (sfep->namelen =3D=3D args->namelen && - sfep->name[0] =3D=3D args->name[0] && - memcmp(args->name, sfep->name, args->namelen) =3D=3D 0) { - args->inumber =3D - xfs_dir2_sf_get_inumber(sfp, + switch (xfs_dir_compname(dp, sfep->name, sfep->namelen, + args->name, args->namelen)) { + case XFS_CMP_EXACT: + args->cmpresult =3D XFS_CMP_EXACT; + args->inumber =3D xfs_dir2_sf_get_inumber(sfp, xfs_dir2_sf_inumberp(sfep)); + if (args->value) { + xfs_free_unicode_nls_name(args->value); + args->value =3D NULL; + } return XFS_ERROR(EEXIST); + + case XFS_CMP_CASE: + if (!args->value) { + args->valuelen =3D xfs_unicode_to_nls( + args->dp->i_mount->m_nls, sfep->name, + sfep->namelen, (char **)&args->value); + if (args->valuelen < 0) + return XFS_ERROR(-args->valuelen); + args->cmpresult =3D XFS_CMP_CASE; + args->inumber =3D xfs_dir2_sf_get_inumber(sfp, + xfs_dir2_sf_inumberp(sfep)); + } + default: ; } } + if (args->cmpresult =3D=3D XFS_CMP_CASE) + return XFS_ERROR(EEXIST); /* * Didn't find it. */ @@ -907,9 +940,8 @@ xfs_dir2_sf_removename( for (i =3D 0, sfep =3D xfs_dir2_sf_firstentry(sfp); i < sfp->hdr.count; i++, sfep =3D xfs_dir2_sf_nextentry(sfp, sfep)) { - if (sfep->namelen =3D=3D args->namelen && - sfep->name[0] =3D=3D args->name[0] && - memcmp(sfep->name, args->name, args->namelen) =3D=3D 0) { + if (xfs_default_compname(dp, sfep->name, sfep->namelen, + args->name, args->namelen) =3D=3D XFS_CMP_EXACT) { ASSERT(xfs_dir2_sf_get_inumber(sfp, xfs_dir2_sf_inumberp(sfep)) =3D=3D args->inumber); @@ -1044,9 +1076,9 @@ xfs_dir2_sf_replace( for (i =3D 0, sfep =3D xfs_dir2_sf_firstentry(sfp); i < sfp->hdr.count; i++, sfep =3D xfs_dir2_sf_nextentry(sfp, sfep)) { - if (sfep->namelen =3D=3D args->namelen && - sfep->name[0] =3D=3D args->name[0] && - memcmp(args->name, sfep->name, args->namelen) =3D=3D 0) { + if (xfs_default_compname(dp, sfep->name, + sfep->namelen, args->name, + args->namelen) =3D=3D XFS_CMP_EXACT) { #if XFS_BIG_INUMS || defined(DEBUG) ino =3D xfs_dir2_sf_get_inumber(sfp, xfs_dir2_sf_inumberp(sfep)); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_itable.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_itable.c 2008-01-18 15:31:25.000000000 +1100 +++ b/fs/xfs/xfs_itable.c 2008-01-18 13:45:10.740061749 +1100 @@ -45,6 +45,8 @@ xfs_internal_inum( xfs_ino_t ino) { return (ino =3D=3D mp->m_sb.sb_rbmino || ino =3D=3D mp->m_sb.sb_rsumin= o || + (xfs_sb_version_hasunicode(&mp->m_sb) && + ino =3D=3D mp->m_sb.sb_cftino) || (XFS_SB_VERSION_HASQUOTA(&mp->m_sb) && (ino =3D=3D mp->m_sb.sb_uquotino || ino =3D=3D mp->m_sb.sb_gquotino)= )); } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_mount.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_mount.c 2008-01-18 15:31:25.000000000 +1100 +++ b/fs/xfs/xfs_mount.c 2008-01-17 17:10:29.777728874 +1100 @@ -25,6 +25,7 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" +#include "xfs_attr.h" #include "xfs_dmapi.h" #include "xfs_mount.h" #include "xfs_bmap_btree.h" @@ -43,6 +44,9 @@ #include "xfs_rw.h" #include "xfs_quota.h" #include "xfs_fsops.h" +#include "xfs_da_btree.h" +#include "xfs_attr_leaf.h" +#include "xfs_unicode.h" = STATIC void xfs_mount_log_sbunit(xfs_mount_t *, __int64_t); STATIC int xfs_uuid_mount(xfs_mount_t *); @@ -119,6 +123,8 @@ static const struct { { offsetof(xfs_sb_t, sb_logsectsize),0 }, { offsetof(xfs_sb_t, sb_logsunit), 0 }, { offsetof(xfs_sb_t, sb_features2), 0 }, + { offsetof(xfs_sb_t, sb_bad_features2), 0 }, + { offsetof(xfs_sb_t, sb_cftino), 0 }, { sizeof(xfs_sb_t), 0 } }; = @@ -171,6 +177,9 @@ xfs_mount_free( sizeof(xfs_perag_t) * mp->m_sb.sb_agcount); } = + if (mp->m_cft) + xfs_unicode_free_cft(mp->m_cft); + spinlock_destroy(&mp->m_ail_lock); spinlock_destroy(&mp->m_sb_lock); mutex_destroy(&mp->m_ilock); @@ -455,6 +464,8 @@ xfs_sb_from_disk( to->sb_logsectsize =3D be16_to_cpu(from->sb_logsectsize); to->sb_logsunit =3D be32_to_cpu(from->sb_logsunit); to->sb_features2 =3D be32_to_cpu(from->sb_features2); + to->sb_bad_features2 =3D be32_to_cpu(from->sb_bad_features2); + to->sb_cftino =3D be64_to_cpu(from->sb_cftino); } = /* @@ -1062,7 +1073,7 @@ xfs_mountfs( /* * Initialize the attribute manager's entries. */ - mp->m_attr_magicpct =3D (mp->m_sb.sb_blocksize * 37) / 100; + xfs_attr_mount(mp); = /* * Initialize the precomputed transaction reservations values. @@ -1165,6 +1176,17 @@ xfs_mountfs( } = /* + * Load in unicode case folding table from disk + */ + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + error =3D xfs_unicode_read_cft(mp); + if (error) { + cmn_err(CE_WARN, "XFS: failed to read case folding table"); + goto error4; + } + } + + /* * If fs is not mounted readonly, then update the superblock * unit and width changes. */ @@ -1220,6 +1242,8 @@ xfs_mountfs( * Free up the root inode. */ VN_RELE(rvp); + if (mp->m_cft) + xfs_unicode_free_cft(mp->m_cft); error3: xfs_log_unmount_dealloc(mp); error2: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_mount.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_mount.h 2008-01-18 15:31:25.000000000 +1100 +++ b/fs/xfs/xfs_mount.h 2007-11-01 13:13:36.858098082 +1100 @@ -54,6 +54,7 @@ typedef struct xfs_trans_reservations { #else struct cred; struct log; +struct nls_table; struct xfs_mount_args; struct xfs_inode; struct xfs_bmbt_irec; @@ -61,6 +62,8 @@ struct xfs_bmap_free; struct xfs_extdelta; struct xfs_swapext; struct xfs_mru_cache; +struct xfs_nameops; +struct xfs_cft; = /* * Prototypes and functions for the Data Migration subsystem. @@ -306,6 +309,10 @@ typedef struct xfs_mount { __uint8_t m_inode_quiesce;/* call quiesce on new inodes. field governed by m_ilock */ __uint8_t m_sectbb_log; /* sectlog - BBSHIFT */ + const struct xfs_nameops *m_dirnameops; /* vector of dir name ops */ + const struct xfs_nameops *m_attrnameops; /* vector of attr name ops */= + const struct xfs_cft *m_cft; /* unicode case fold table */ + struct nls_table *m_nls; /* active NLS table */ int m_dirblksize; /* directory block sz--bytes */ int m_dirblkfsbs; /* directory block sz--fsbs */ xfs_dablk_t m_dirdatablk; /* blockno of dir data v2 */ @@ -371,7 +378,10 @@ typedef struct xfs_mount { counters */ #define XFS_MOUNT_FILESTREAMS (1ULL << 24) /* enable the filestreams allocator */ - +#define XFS_MOUNT_CI_LOOKUP (1ULL << 25) /* enable case-insensitive + * file lookup */ +#define XFS_MOUNT_CI_ATTR (1ULL << 26) /* enable case-insensitive + attribute names */ = /* * Default minimum read and write sizes. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_rename.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_rename.c 2008-01-18 15:31:25.000000000 +1100 +++ b/fs/xfs/xfs_rename.c 2008-01-17 12:25:31.652529581 +1100 @@ -130,7 +130,9 @@ xfs_lock_for_rename( lock_mode =3D xfs_ilock_map_shared(dp2); } = - error =3D xfs_dir_lookup_int(dp2, lock_mode, vname2, &inum2, &ip2); + error =3D xfs_dir_lookup_int(dp2, lock_mode, vname2, &inum2, &ip2, + NULL, NULL); + if (error =3D=3D ENOENT) { /* target does not need to exist. */ inum2 =3D 0; } else if (error) { @@ -214,6 +216,7 @@ xfs_lock_for_rename( for (;i < 4; i++) { i_tab[i] =3D NULL; } + return 0; } = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_sb.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_sb.h 2008-01-18 15:31:25.000000000 +1100 +++ b/fs/xfs/xfs_sb.h 2007-10-23 16:55:47.440178601 +1000 @@ -46,10 +46,12 @@ struct xfs_mount; #define XFS_SB_VERSION_SECTORBIT 0x0800 #define XFS_SB_VERSION_EXTFLGBIT 0x1000 #define XFS_SB_VERSION_DIRV2BIT 0x2000 +#define XFS_SB_VERSION_OLDCIBIT 0x4000 #define XFS_SB_VERSION_MOREBITSBIT 0x8000 #define XFS_SB_VERSION_OKSASHFBITS \ (XFS_SB_VERSION_EXTFLGBIT | \ - XFS_SB_VERSION_DIRV2BIT) + XFS_SB_VERSION_DIRV2BIT | \ + XFS_SB_VERSION_OLDCIBIT) #define XFS_SB_VERSION_OKREALFBITS \ (XFS_SB_VERSION_ATTRBIT | \ XFS_SB_VERSION_NLINKBIT | \ @@ -77,10 +79,12 @@ struct xfs_mount; #define XFS_SB_VERSION2_LAZYSBCOUNTBIT 0x00000002 /* Superblk counters = */ #define XFS_SB_VERSION2_RESERVED4BIT 0x00000004 #define XFS_SB_VERSION2_ATTR2BIT 0x00000008 /* Inline attr rework */ +#define XFS_SB_VERSION2_UNICODEBIT 0x00000020 /* Unicode names */ = #define XFS_SB_VERSION2_OKREALFBITS \ (XFS_SB_VERSION2_LAZYSBCOUNTBIT | \ - XFS_SB_VERSION2_ATTR2BIT) + XFS_SB_VERSION2_ATTR2BIT | \ + XFS_SB_VERSION2_UNICODEBIT) #define XFS_SB_VERSION2_OKSASHFBITS \ (0) #define XFS_SB_VERSION2_OKREALBITS \ @@ -145,6 +149,9 @@ typedef struct xfs_sb { __uint16_t sb_logsectsize; /* sector size for the log, bytes */ __uint32_t sb_logsunit; /* stripe unit size for the log */ __uint32_t sb_features2; /* additional feature bits */ + __uint32_t sb_bad_features2; /* features2 could be here */ + xfs_ino_t sb_cftino; /* unicode case folding table inode */ + /* must be padded to 64 bit alignment */ } xfs_sb_t; = /* @@ -205,6 +212,9 @@ typedef struct xfs_dsb { __be16 sb_logsectsize; /* sector size for the log, bytes */ __be32 sb_logsunit; /* stripe unit size for the log */ __be32 sb_features2; /* additional feature bits */ + __be32 sb_bad_features2; /* features2 could be here */ + __be64 sb_cftino; /* unicode case folding table inode */ + /* must be padded to 64 bit alignment */ } xfs_dsb_t; = /* @@ -223,7 +233,7 @@ typedef enum { XFS_SBS_GQUOTINO, XFS_SBS_QFLAGS, XFS_SBS_FLAGS, XFS_SBS_SHARED_VN, XFS_SBS_INOALIGNMT, XFS_SBS_UNIT, XFS_SBS_WIDTH, XFS_SBS_DIRBLKLOG, XFS_SBS_LOGSECTLOG, XFS_SBS_LOGSECTSIZE, XFS_SBS_LOGSUNIT, - XFS_SBS_FEATURES2, + XFS_SBS_FEATURES2, XFS_SBS_BAD_FEATURES2, XFS_SBS_CFTINO, XFS_SBS_FIELDCOUNT } xfs_sb_field_t; = @@ -248,13 +258,15 @@ typedef enum { #define XFS_SB_IFREE XFS_SB_MVAL(IFREE) #define XFS_SB_FDBLOCKS XFS_SB_MVAL(FDBLOCKS) #define XFS_SB_FEATURES2 XFS_SB_MVAL(FEATURES2) +#define XFS_SB_CASEFOLDINO XFS_SB_MVAL(CASEFOLDINO) #define XFS_SB_NUM_BITS ((int)XFS_SBS_FIELDCOUNT) #define XFS_SB_ALL_BITS ((1LL << XFS_SB_NUM_BITS) - 1) #define XFS_SB_MOD_BITS \ (XFS_SB_UUID | XFS_SB_ROOTINO | XFS_SB_RBMINO | XFS_SB_RSUMINO | \ XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO | XFS_SB_GQUOTINO | \ XFS_SB_QFLAGS | XFS_SB_SHARED_VN | XFS_SB_UNIT | XFS_SB_WIDTH | \ - XFS_SB_ICOUNT | XFS_SB_IFREE | XFS_SB_FDBLOCKS | XFS_SB_FEATURES2) + XFS_SB_ICOUNT | XFS_SB_IFREE | XFS_SB_FDBLOCKS | XFS_SB_FEATURES2 | \= + XFS_SB_CFTINO) = = /* @@ -463,6 +475,12 @@ static inline int xfs_sb_version_hassect ((sbp)->sb_versionnum & XFS_SB_VERSION_SECTORBIT); } = +static inline int xfs_sb_version_hasoldci(xfs_sb_t *sbp) +{ + return (XFS_SB_VERSION_NUM(sbp) =3D=3D XFS_SB_VERSION_4) && \ + ((sbp)->sb_versionnum & XFS_SB_VERSION_OLDCIBIT); +} + #define XFS_SB_VERSION_HASMOREBITS(sbp) xfs_sb_version_hasmorebits(sbp)= static inline int xfs_sb_version_hasmorebits(xfs_sb_t *sbp) { @@ -502,6 +520,13 @@ static inline void xfs_sb_version_addatt ((sbp)->sb_features2 | XFS_SB_VERSION2_ATTR2BIT))); } = +static inline int xfs_sb_version_hasunicode(xfs_sb_t *sbp) +{ + return (xfs_sb_version_hasmorebits(sbp) && \ + ((sbp)->sb_features2 & XFS_SB_VERSION2_UNICODEBIT)); +} + + /* * end of superblock version macros */ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_types.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_types.h 2008-01-18 15:31:25.000000000 +1100 +++ b/fs/xfs/xfs_types.h 2007-10-25 17:49:01.982895520 +1000 @@ -160,4 +160,9 @@ typedef enum { XFS_BTNUM_MAX } xfs_btnum_t; = +typedef struct xfs_string { + const uchar_t *name; + int len; +} xfs_string_t; + #endif /* __XFS_TYPES_H__ */ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_unicode.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_unicode.c 2006-06-17 00:58:24.000000000 +1000 +++ b/fs/xfs/xfs_unicode.c 2008-01-17 17:11:29.734083909 +1100 @@ -0,0 +1,523 @@ +/* + * Copyright (c) 2007 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation,= + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "xfs.h" +#include "xfs_fs.h" +#include "xfs_bit.h" +#include "xfs_log.h" +#include "xfs_inum.h" +#include "xfs_clnt.h" +#include "xfs_trans.h" +#include "xfs_sb.h" +#include "xfs_ag.h" +#include "xfs_dir2.h" +#include "xfs_alloc.h" +#include "xfs_dmapi.h" +#include "xfs_mount.h" +#include "xfs_bmap_btree.h" +#include "xfs_alloc_btree.h" +#include "xfs_ialloc_btree.h" +#include "xfs_dir2_sf.h" +#include "xfs_attr_sf.h" +#include "xfs_dinode.h" +#include "xfs_inode.h" +#include "xfs_btree.h" +#include "xfs_ialloc.h" +#include "xfs_itable.h" +#include "xfs_rtalloc.h" +#include "xfs_error.h" +#include "xfs_bmap.h" +#include "xfs_rw.h" +#include "xfs_unicode.h" + +#define MAX_FOLD_CHARS 4 + +static kmem_zone_t *xfs_nls_uni_zone; + +static inline int +xfs_casefold( + const xfs_cft_t *cft, + __uint16_t c, + __uint16_t *fc) +{ + __uint16_t *table =3D XFS_CFT_PTR(cft, 0); + __uint16_t tmp =3D table[c >> 8]; + int i; + + if (!tmp) { + *fc =3D c; + return 1; + } + tmp =3D table[tmp + (c & 0xff)]; + if ((tmp & 0xf000) !=3D 0xe000) { + *fc =3D tmp; + return 1; + } + i =3D ((tmp >> 10) & 0x3) + 2; + ASSERT(i < cft->num_tables); + table =3D XFS_CFT_PTR(cft, i - 1) + ((tmp & 0x3ff) * i); + + memcpy(fc, table, sizeof(__uint16_t) * i); + + return i; +} + +static inline int +xfs_utf8_casefold( + const xfs_cft_t *cft, + const uchar_t **name, + int *namelen, + __uint16_t *fc) +{ + wchar_t uc; + + if (*namelen =3D=3D 0) + return 0; + + if (**name & 0x80) { + int n =3D utf8_mbtowc(&uc, *name, *namelen); + if (n < 0) { + (*namelen)--; + *fc =3D *(*name)++; + return 1; + } + *name +=3D n; + *namelen -=3D n; + } else { + uc =3D *(*name)++; + (*namelen)--; + } + return xfs_casefold(cft, uc, fc); +} + +__uint32_t +xfs_unicode_hash( + const xfs_cft_t *cft, + const uchar_t *name, + int namelen) +{ + __uint32_t hash =3D 0; + __uint16_t fc[MAX_FOLD_CHARS]; + int nfc; + int i; + + while (namelen > 0) { + nfc =3D xfs_utf8_casefold(cft, &name, &namelen, fc); + for (i =3D 0; i < nfc; i++) + hash =3D fc[i] ^ rol32(hash, 7); + } + return hash; +} + +int +xfs_unicode_casecmp( + const xfs_cft_t *cft, + const uchar_t *name1, + int len1, + const uchar_t *name2, + int len2) +{ + __uint16_t fc1[MAX_FOLD_CHARS], fc2[MAX_FOLD_CHARS]; + __uint16_t *pfc1, *pfc2; + int nfc1, nfc2; + + nfc1 =3D xfs_utf8_casefold(cft, &name1, &len1, fc1); + pfc1 =3D fc1; + nfc2 =3D xfs_utf8_casefold(cft, &name2, &len2, fc2); + pfc2 =3D fc2; + + while (nfc1 > 0 && nfc2 > 0) { + if (*pfc1 !=3D *pfc2) + return (*pfc1 < *pfc2) ? -1 : 1; + if (!--nfc1) { + nfc1 =3D xfs_utf8_casefold(cft, &name1, &len1, fc1); + pfc1 =3D fc1; + } else + pfc1++; + if (!--nfc2) { + nfc2 =3D xfs_utf8_casefold(cft, &name2, &len2, fc2); + pfc2 =3D fc2; + } else + pfc2++; + } + if (nfc1 !=3D nfc2) + return (nfc1 < nfc2) ? -1 : 1; + return 0; +} + + +char * +xfs_alloc_unicode_nls_name(void) +{ + return kmem_zone_alloc(xfs_nls_uni_zone, KM_SLEEP); +} + + +void +xfs_free_unicode_nls_name( + char *name) +{ + kmem_zone_free(xfs_nls_uni_zone, name); +} + +int +xfs_nls_to_unicode( + struct nls_table *nls, + const char *nls_name, + int nls_namelen, + char **uni_name) +{ + char *n; + int i, o; + wchar_t uc; + int nlen; + int u8len; + int rval; + + n =3D *uni_name ? *uni_name : xfs_alloc_unicode_nls_name(); + + if (!nls) { + if (nls_namelen > MAXNAMELEN) { + rval =3D -ENAMETOOLONG; + goto err_out; + } + memcpy(n, nls_name, nls_namelen); + *uni_name =3D n; + return nls_namelen; + } + + for (i =3D 0, o =3D 0; i < nls_namelen; i +=3D nlen, o +=3D u8len) { + nlen =3D nls->char2uni(nls_name + i, nls_namelen - i, &uc); + if (nlen < 0) { + rval =3D nlen; + goto err_out; + } + if (uc >=3D 0xfffe || (uc >=3D 0xd800 && uc <=3D 0xdfff)) { + rval =3D -EINVAL; /* don't support chars outside BMP */ + goto err_out; + } + u8len =3D utf8_wctomb(n + o, uc, MAXNAMELEN - o); + if (u8len <=3D 0) { + rval =3D (MAXNAMELEN - o < 3) ? -ENAMETOOLONG : -EINVAL; + goto err_out; + } + } + *uni_name =3D n; + return o; +err_out: + if (*uni_name =3D=3D NULL) + xfs_free_unicode_nls_name(n); + return rval; +} + +int +xfs_unicode_to_nls( + struct nls_table *nls, + const char *uni_name, + int uni_namelen, + char **nls_name) +{ + char *n; + int i, o; + wchar_t uc; + int nlen; + int u8len; + int rval; + + n =3D *nls_name ? *nls_name : xfs_alloc_unicode_nls_name(); + + if (!nls) { + if (uni_namelen > MAXNAMELEN) { + rval =3D -ENAMETOOLONG; + goto err_out; + } + memcpy(n, uni_name, uni_namelen); + *nls_name =3D n; + return uni_namelen; + } + + for (i =3D 0, o =3D 0; i < uni_namelen && o < MAXNAMELEN; + i +=3D u8len, o +=3D nlen) { + u8len =3D utf8_mbtowc(&uc, uni_name + i, uni_namelen - i); + if (u8len < 0) { + rval =3D -EINVAL; + goto err_out; + } + nlen =3D nls->uni2char(uc, n + o, MAXNAMELEN - o); + if (nlen =3D=3D -EINVAL) { + n[o] =3D '?'; + nlen =3D 1; + } else if (nlen < 0) { + rval =3D nlen; + goto err_out; + } + } + if (i =3D=3D uni_namelen) { + *nls_name =3D n; + return o; + } + + rval =3D -ENAMETOOLONG; +err_out: + if (*nls_name =3D=3D NULL) + xfs_free_unicode_nls_name(n); + return rval; +} + +int +xfs_unicode_validate( + const uchar_t *name, + int namelen) +{ + wchar_t uc; + int i, nlen; + + for (i =3D 0; i < namelen; i +=3D nlen) { + if (*name >=3D 0xf0) { + cmn_err(CE_WARN, "xfs_unicode_validate: " + "UTF-8 char beyond U+FFFF\n"); + return -EINVAL; + } + /* utf8_mbtowc must fail on overlong sequences too */ + nlen =3D utf8_mbtowc(&uc, name + i, namelen - i); + if (nlen < 0) { + cmn_err(CE_WARN, "xfs_unicode_validate: " + "invalid UTF-8 sequence\n"); + return -EILSEQ; + } + /* check for invalid/surrogate/private unicode chars */ + if (uc >=3D 0xfffe || (uc >=3D 0xd800 && uc <=3D 0xf8ff)) { + cmn_err(CE_WARN, "xfs_unicode_validate: " + "unsupported UTF-8 char\n"); + return -EINVAL; + } + } + return 0; +} + +/* + * Unicode Case Fold Table management + */ + +struct cft_item { + xfs_cft_t *table; + int size; + int refcount; +}; + +static mutex_t cft_lock; +static int cft_size; +static struct cft_item *cft_list; + +static xfs_cft_t * +add_cft( + xfs_dcft_t *dcft, + int size) +{ + int found =3D 0; + int i, j; + xfs_cft_t *cft; + __be16 *duc; + __uint16_t *uc; + + mutex_lock(&cft_lock); + + for (i =3D 0; i < cft_size; i++) { + if (cft_list[i].size !=3D size) + continue; + cft =3D cft_list[i].table; + if (cft->num_tables !=3D be32_to_cpu(dcft->num_tables) || + cft->flags !=3D be32_to_cpu(dcft->flags)) + continue; + found =3D 1; + for (j =3D 0; j < cft->num_tables; j++) { + if (cft->table_offset[j] !=3D + be32_to_cpu(dcft->table_offset[j])) { + found =3D 0; + break; + } + } + if (found) { + cft_list[i].refcount++; + mutex_unlock(&cft_lock); + return cft; + } + } + + cft =3D vmalloc(size); + if (!cft) { + mutex_unlock(&cft_lock); + return NULL; + } + cft->magic =3D be32_to_cpu(dcft->magic); + cft->flags =3D be32_to_cpu(dcft->flags); + cft->num_tables =3D be32_to_cpu(dcft->num_tables); + ASSERT(cft->num_tables <=3D MAX_FOLD_CHARS); + for (i =3D 0; i < cft->num_tables; i++) + cft->table_offset[i] =3D be32_to_cpu(dcft->table_offset[i]); + j =3D (size - cft->table_offset[0]) / sizeof(__uint16_t); + uc =3D XFS_CFT_PTR(cft, 0); + duc =3D XFS_DCFT_PTR(dcft, 0); + for (i =3D 0; i < j; i++) + uc[i] =3D be16_to_cpu(duc[i]); + + cft_list =3D kmem_realloc(cft_list, + (cft_size + 1) * sizeof(struct cft_item), + cft_size * sizeof(struct cft_item), KM_SLEEP); + cft_list[cft_size].table =3D cft; + cft_list[cft_size].size =3D size; + cft_list[cft_size].refcount =3D 1; + cft_size++; + + mutex_unlock(&cft_lock); + + return cft; +} + +static void +remove_cft( + const xfs_cft_t *cft) +{ + int i; + + mutex_lock(&cft_lock); + + for (i =3D 0; i < cft_size; i++) { + if (cft_list[i].table =3D=3D cft) { + ASSERT(cft_list[i].refcount > 0); + cft_list[i].refcount--; + break; + } + } + + mutex_unlock(&cft_lock); +} + + +int +xfs_unicode_read_cft( + xfs_mount_t *mp) +{ + int error; + xfs_inode_t *cftip; + int size; + int nfsb; + int nmap; + xfs_bmbt_irec_t *mapp; + int n; + int byte_cnt; + xfs_buf_t *bp; + char *table; + xfs_dcft_t *dcft; + + if (mp->m_sb.sb_cftino =3D=3D NULLFSINO || mp->m_sb.sb_cftino =3D=3D 0= ) + return EINVAL; + error =3D xfs_iget(mp, NULL, mp->m_sb.sb_cftino, 0, 0, &cftip, 0); + if (error) + return error; + ASSERT(cftip !=3D NULL); + + size =3D cftip->i_d.di_size; + nfsb =3D cftip->i_d.di_nblocks; + + table =3D vmalloc(size); + if (!table) { + xfs_iput(cftip, 0); + return ENOMEM; + } + dcft =3D (xfs_dcft_t *)table; + + nmap =3D nfsb; + mapp =3D kmem_alloc(nfsb * sizeof(xfs_bmbt_irec_t), KM_SLEEP); + + error =3D xfs_bmapi(NULL, cftip, 0, nfsb, 0, NULL, 0, mapp, &nmap, + NULL, NULL); + if (error) + goto out; + + for (n =3D 0; n < nmap; n++) { + byte_cnt =3D XFS_FSB_TO_B(mp, mapp[n].br_blockcount); + + error =3D xfs_read_buf(mp, mp->m_ddev_targp, + XFS_FSB_TO_DADDR(mp, mapp[n].br_startblock), + BTOBB(byte_cnt), 0, &bp); + if (error) + goto out; + + if (size < byte_cnt) + byte_cnt =3D size; + size -=3D byte_cnt; + memcpy(table, XFS_BUF_PTR(bp), byte_cnt); + table +=3D byte_cnt; + xfs_buf_relse(bp); + } + + /* verify case table read off disk */ + if (!uuid_equal(&dcft->uuid, &mp->m_sb.sb_uuid)) { + error =3D EINVAL; + goto out; + } + + /* clear UUID for in-memory copy/compare */ + memset(&dcft->uuid, 0, sizeof(dcft->uuid)); + + mp->m_cft =3D add_cft(dcft, cftip->i_d.di_size); + if (mp->m_cft =3D=3D NULL) + error =3D ENOMEM; + +out: + xfs_iput(cftip, 0); + kmem_free(mapp, nfsb * sizeof(xfs_bmbt_irec_t)); + vfree(dcft); + + return error; +} + +void +xfs_unicode_free_cft( + const xfs_cft_t *cft) +{ + remove_cft(cft); +} + +void +xfs_unicode_init(void) +{ + mutex_init(&cft_lock); + xfs_nls_uni_zone =3D kmem_zone_init(MAXNAMELEN, "xfs_nls_uni"); +} + +void +xfs_unicode_uninit(void) +{ + int i; + + mutex_lock(&cft_lock); + + for (i =3D 0; i < cft_size; i++) { + ASSERT(cft_list[i].refcount =3D=3D 0); + vfree(cft_list[i].table); + } + kmem_free(cft_list, cft_size * sizeof(struct cft_item)); + cft_size =3D 0; + cft_list =3D NULL; + + mutex_unlock(&cft_lock); + + kmem_zone_destroy(xfs_nls_uni_zone); +} =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_unicode.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_unicode.h 2006-06-17 00:58:24.000000000 +1000 +++ b/fs/xfs/xfs_unicode.h 2008-01-11 11:59:50.325468145 +1100 @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2007 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation,= + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#ifndef __XFS_UNICODE_H__ +#define __XFS_UNICODE_H__ + +#define XFS_CFT_MAGIC 0x58434654 /* 'XCFT' */ +#define XFS_CFT_FLAG_TURKIC 0x00000001 +#define XFS_CFT_FLAG_MAX 0x00000001 + +/* + * Case Fold Table - on disk version. Must match the incore version bel= ow. + */ +typedef struct xfs_dcft { + __be32 magic; /* validity check */ + __be32 flags; + uuid_t uuid; /* UUID of the filesystem */ + __be32 crc; /* for future support */ + __be32 num_tables; /* single, double, etc */ + __be32 table_offset[1]; +} xfs_dcft_t; + +/* + * Case Fold Table - in core version. Must match the ondisk version abo= ve. + */ +typedef struct xfs_cft { + __uint32_t magic; + __uint32_t flags; + uuid_t uuid; /* UUID of the filesystem */ + __uint32_t crc; + __uint32_t num_tables; /* single, double, etc */ + __uint32_t table_offset[1];/* num_tables sized */ + /* 16-bit array tables immediately follow */ +} xfs_cft_t; + +#define XFS_CFT_PTR(t,n) (__uint16_t *)(((char *)(t)) + \ + (t)->table_offset[n]) +#define XFS_DCFT_PTR(t,n) (__be16 *)(((char *)(t)) + \ + be32_to_cpu((t)->table_offset[n])) + +void xfs_unicode_init(void); +void xfs_unicode_uninit(void); + +__uint32_t xfs_unicode_hash(const xfs_cft_t *cft, + const uchar_t *name, int namelen); + +int xfs_unicode_casecmp(const xfs_cft_t *cft, const uchar_t *name1, + int len1, const uchar_t *name2, int len2); + +char *xfs_alloc_unicode_nls_name(void); +void xfs_free_unicode_nls_name(char *name); +int xfs_nls_to_unicode(struct nls_table *nls, const char *nls_name, + int nls_namelen, char **uni_name); +int xfs_unicode_to_nls(struct nls_table *nls, const char *uni_name, + int uni_namelen, char **nls_name); + +int xfs_unicode_validate(const uchar_t *name, int namelen); + +int xfs_unicode_read_cft(struct xfs_mount *mp); +void xfs_unicode_free_cft(const xfs_cft_t *cft); + +#endif /* __XFS_UNICODE_H__ */ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_utils.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_utils.c 2008-01-18 15:31:25.000000000 +1100 +++ b/fs/xfs/xfs_utils.c 2007-10-26 15:42:04.856766756 +1000 @@ -39,6 +39,7 @@ #include "xfs_rw.h" #include "xfs_itable.h" #include "xfs_utils.h" +#include "xfs_unicode.h" = /* * xfs_get_dir_entry is used to get a reference to an inode given @@ -69,13 +70,16 @@ xfs_dir_lookup_int( uint lock_mode, bhv_vname_t *dentry, xfs_ino_t *inum, - xfs_inode_t **ipp) + xfs_inode_t **ipp, + char **actual_name, + int *actual_namelen) { int error; = xfs_itrace_entry(dp); = - error =3D xfs_dir_lookup(NULL, dp, VNAME(dentry), VNAMELEN(dentry), in= um); + error =3D xfs_dir_lookup(NULL, dp, VNAME(dentry), VNAMELEN(dentry), in= um, + actual_name, actual_namelen); if (!error) { /* * Unlock the directory. We do this because we can't @@ -102,6 +106,8 @@ xfs_dir_lookup_int( xfs_ilock(dp, lock_mode); error =3D XFS_ERROR(ENOENT); } + if (error && actual_name) + xfs_free_unicode_nls_name(*actual_name); } return error; } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_utils.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_utils.h 2008-01-18 15:31:25.000000000 +1100 +++ b/fs/xfs/xfs_utils.h 2007-10-26 15:35:54.052564595 +1000 @@ -23,7 +23,7 @@ = extern int xfs_get_dir_entry (bhv_vname_t *, xfs_inode_t **); extern int xfs_dir_lookup_int (xfs_inode_t *, uint, bhv_vname_t *, xfs_= ino_t *, - xfs_inode_t **); + xfs_inode_t **, char **, int *); extern int xfs_truncate_file (xfs_mount_t *, xfs_inode_t *); extern int xfs_dir_ialloc (xfs_trans_t **, xfs_inode_t *, mode_t, xfs_n= link_t, xfs_dev_t, cred_t *, prid_t, int, =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_vfsops.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_vfsops.c 2008-01-18 15:31:25.000000000 +1100 +++ b/fs/xfs/xfs_vfsops.c 2008-01-11 14:47:36.214448806 +1100 @@ -56,7 +56,7 @@ #include "xfs_fsops.h" #include "xfs_vnodeops.h" #include "xfs_vfsops.h" - +#include "xfs_unicode.h" = int xfs_init(void) @@ -81,6 +81,7 @@ xfs_init(void) xfs_acl_zone_init(xfs_acl_zone, "xfs_acl"); xfs_mru_cache_init(); xfs_filestream_init(); + xfs_unicode_init(); = /* * The size of the zone allocated buf log item is the maximum @@ -158,6 +159,7 @@ xfs_cleanup(void) xfs_cleanup_procfs(); xfs_sysctl_unregister(); xfs_refcache_destroy(); + xfs_unicode_uninit(); xfs_filestream_uninit(); xfs_mru_cache_uninit(); xfs_acl_zone_destroy(xfs_acl_zone); @@ -247,7 +249,6 @@ xfs_start_flags( mp->m_logname =3D kmem_alloc(strlen(ap->logname) + 1, KM_SLEEP); strcpy(mp->m_logname, ap->logname); } - if (ap->flags & XFSMNT_WSYNC) mp->m_flags |=3D XFS_MOUNT_WSYNC; #if XFS_BIG_INUMS @@ -404,6 +405,39 @@ xfs_finish_flags( mp->m_qflags |=3D XFS_OQUOTA_ENFD; } = + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + if (ap->flags2 & XFSMNT2_CILOOKUP) + mp->m_flags |=3D XFS_MOUNT_CI_LOOKUP; + if (ap->flags2 & XFSMNT2_CIATTR) + mp->m_flags |=3D XFS_MOUNT_CI_ATTR; + + mp->m_nls =3D ap->nls[0] ? load_nls(ap->nls) : load_nls_default(); + if (!mp->m_nls) { + cmn_err(CE_WARN, + "XFS: unable to load nls mapping \"%s\"\n", ap->nls); + return XFS_ERROR(EINVAL); + } + if (strcmp(mp->m_nls->charset, XFS_NLS_UTF8) =3D=3D 0) { + /* special case utf8 - no translation required */ + unload_nls(mp->m_nls); + mp->m_nls =3D NULL; + } + } else { + /* + * Check for mount options which require a Unicode FS + */ + if (ap->flags2 & (XFSMNT2_CILOOKUP | XFSMNT2_CIATTR)) { + cmn_err(CE_WARN, + "XFS: can't do case-insensitive mount on non-utf8 filesystem"); + return XFS_ERROR(EINVAL); + + } + if (ap->nls[0]) { + cmn_err(CE_WARN, + "XFS: can't use nls mount option on non-utf8 filesystem"); + return XFS_ERROR(EINVAL); + } + } return 0; } = @@ -641,6 +675,8 @@ out: xfs_unmountfs(mp, credp); xfs_qmops_put(mp); xfs_dmops_put(mp); + if (mp->m_nls) + unload_nls(mp->m_nls); kmem_free(mp, sizeof(xfs_mount_t)); } = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_vnodeops.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_vnodeops.c 2008-01-18 15:31:25.000000000 +1100 +++ b/fs/xfs/xfs_vnodeops.c 2008-01-11 14:20:12.000000000 +1100 @@ -1793,7 +1793,9 @@ int xfs_lookup( xfs_inode_t *dp, bhv_vname_t *dentry, - bhv_vnode_t **vpp) + bhv_vnode_t **vpp, + char **actual_name, + int *actual_namelen) { xfs_inode_t *ip; xfs_ino_t e_inum; @@ -1806,7 +1808,8 @@ xfs_lookup( return XFS_ERROR(EIO); = lock_mode =3D xfs_ilock_map_shared(dp); - error =3D xfs_dir_lookup_int(dp, lock_mode, dentry, &e_inum, &ip); + error =3D xfs_dir_lookup_int(dp, lock_mode, dentry, &e_inum, &ip, + actual_name, actual_namelen); if (!error) { *vpp =3D XFS_ITOV(ip); xfs_itrace_ref(ip); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_vnodeops.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_vnodeops.h 2008-01-18 15:31:25.000000000 +1100 +++ b/fs/xfs/xfs_vnodeops.h 2008-01-11 14:20:12.000000000 +1100 @@ -25,7 +25,7 @@ int xfs_fsync(struct xfs_inode *ip, int = int xfs_release(struct xfs_inode *ip); int xfs_inactive(struct xfs_inode *ip); int xfs_lookup(struct xfs_inode *dp, bhv_vname_t *dentry, - bhv_vnode_t **vpp); + bhv_vnode_t **vpp, char **actual_name, int *actual_namelen); int xfs_create(struct xfs_inode *dp, bhv_vname_t *dentry, mode_t mode, xfs_dev_t rdev, bhv_vnode_t **vpp, struct cred *credp); int xfs_remove(struct xfs_inode *dp, bhv_vname_t *dentry); ------------86aCZzNf3aen1MAxxPn749-- From owner-xfs@oss.sgi.com Thu Jan 17 20:42:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 20:42:51 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=AWL,BAYES_50,J_CHICKENPOX_14, J_CHICKENPOX_42,J_CHICKENPOX_43,J_CHICKENPOX_45,J_CHICKENPOX_47, J_CHICKENPOX_48,J_CHICKENPOX_51,J_CHICKENPOX_53,J_CHICKENPOX_55, J_CHICKENPOX_57,J_CHICKENPOX_61,J_CHICKENPOX_62,J_CHICKENPOX_63, J_CHICKENPOX_64,J_CHICKENPOX_65,J_CHICKENPOX_66,J_CHICKENPOX_72, J_CHICKENPOX_73,J_CHICKENPOX_75,J_CHICKENPOX_83 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0I4gM8E021086 for ; Thu, 17 Jan 2008 20:42:24 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA08045; Fri, 18 Jan 2008 15:42:39 +1100 Date: Fri, 18 Jan 2008 15:43:52 +1100 To: "xfs@oss.sgi.com" Subject: [REVIEW 2/2] Case insensitive support for XFS - user-space From: "Barry Naujok" Organization: SGI Cc: xfs-dev Content-Type: multipart/mixed; boundary=----------blQY9A8HShDiztkzvReN2F MIME-Version: 1.0 Message-ID: User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14173 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs ------------blQY9A8HShDiztkzvReN2F Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 Content-Transfer-Encoding: 7bit This patch relies on the dinode.c refactoring patch posted recently. I have attached the latest version (with fixes pointed out by Chandan). db/Makefile | 2 db/cft.c | 135 ++++++++ db/cft.h | 23 + db/check.c | 236 ++++++++++++++ db/command.c | 2 db/field.c | 3 db/field.h | 1 db/inode.c | 2 db/metadump.c | 3 db/sb.c | 5 db/type.c | 2 db/type.h | 2 include/casefoldtable.h | 29 + include/libxfs.h | 12 include/xfs_attr_leaf.h | 8 include/xfs_da_btree.h | 34 ++ include/xfs_dir2.h | 7 include/xfs_sb.h | 33 +- include/xfs_unicode.h | 69 ++++ libxfs/Makefile | 6 libxfs/casefoldtable.c | 760 ++++++++++++++++++++++++++++++++++++++++++++++++ libxfs/init.c | 10 libxfs/utf8.c | 85 +++++ libxfs/xfs.h | 20 + libxfs/xfs_attr.c | 35 +- libxfs/xfs_attr_leaf.c | 11 libxfs/xfs_da_btree.c | 86 +++++ libxfs/xfs_dir2.c | 220 ++++++++----- libxfs/xfs_dir2_block.c | 5 libxfs/xfs_dir2_data.c | 3 libxfs/xfs_mount.c | 2 libxfs/xfs_unicode.c | 405 +++++++++++++++++++++++++ mdrestore/Makefile | 2 mkfs/proto.c | 24 + mkfs/xfs_mkfs.c | 101 +++--- mkfs/xfs_mkfs.h | 13 repair/agheader.c | 12 repair/dino_chunks.c | 15 repair/dinode.c | 112 +++++++ repair/dir2.c | 3 repair/incore.h | 1 repair/phase2.c | 19 + repair/phase6.c | 257 ++++++++++------ repair/xfs_repair.c | 20 + ------------blQY9A8HShDiztkzvReN2F Content-Disposition: attachment; filename=dinode.patch Content-Type: text/x-patch; name=dinode.patch Content-Transfer-Encoding: Quoted-Printable =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D xfsprogs/repair/dino_chunks.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D Index: ci/xfsprogs/repair/dino_chunks.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/repair/dino_chunks.c 2007-11-16 14:45:56.000000000 = +1100 +++ ci/xfsprogs/repair/dino_chunks.c 2008-01-18 14:50:42.000000000 +1100= @@ -593,7 +593,6 @@ xfs_agino_t agino; xfs_agblock_t agbno; int dirty =3D 0; - int cleared =3D 0; int isa_dir =3D 0; int blks_per_cluster; int cluster_count; @@ -777,8 +776,7 @@ = status =3D process_dinode(mp, dino, agno, agino, is_inode_free(ino_rec, irec_offset), - &ino_dirty, &cleared, &is_used, - ino_discovery, check_dups, + &ino_dirty, &is_used,ino_discovery, check_dups, extra_attr_check, &isa_dir, &parent); = ASSERT(is_used !=3D 3); Index: ci/xfsprogs/repair/dinode.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/repair/dinode.c 2007-11-16 14:45:56.000000000 +1100= +++ ci/xfsprogs/repair/dinode.c 2008-01-18 14:57:36.000000000 +1100 @@ -58,9 +58,6 @@ case XFS_DINODE_FMT_LOCAL: offset +=3D INT_GET(dinoc->di_size, ARCH_CONVERT); break; - case XFS_DINODE_FMT_UUID: - offset +=3D sizeof(uuid_t); - break; case XFS_DINODE_FMT_EXTENTS: offset +=3D INT_GET(dinoc->di_nextents, ARCH_CONVERT) * sizeof(xfs_bm= bt_rec_32_t); break; @@ -1563,8 +1560,11 @@ * bogus */ int -process_symlink(xfs_mount_t *mp, xfs_ino_t lino, xfs_dinode_t *dino, - blkmap_t *blkmap) +process_symlink( + xfs_mount_t *mp, + xfs_ino_t lino, + xfs_dinode_t *dino, + blkmap_t *blkmap) { xfs_dfsbno_t fsbno; xfs_dinode_core_t *dinoc =3D &dino->di_core; @@ -1673,8 +1673,7 @@ * called to process the set of misc inode special inode types * that have no associated data storage (fifos, pipes, devices, etc.). */ -/* ARGSUSED */ -int +static int process_misc_ino_types(xfs_mount_t *mp, xfs_dinode_t *dino, xfs_ino_t lino, @@ -1693,27 +1692,27 @@ /* * must also have a zero size */ - if (INT_GET(dino->di_core.di_size, ARCH_CONVERT) !=3D 0) { + if (dino->di_core.di_size) { switch (type) { case XR_INO_CHRDEV: do_warn(_("size of character device inode %llu !=3D 0 " "(%lld bytes)\n"), lino, - INT_GET(dino->di_core.di_size, ARCH_CONVERT)); + be64_to_cpu(dino->di_core.di_size)); break; case XR_INO_BLKDEV: do_warn(_("size of block device inode %llu !=3D 0 " "(%lld bytes)\n"), lino, - INT_GET(dino->di_core.di_size, ARCH_CONVERT)); + be64_to_cpu(dino->di_core.di_size)); break; case XR_INO_SOCK: do_warn(_("size of socket inode %llu !=3D 0 " "(%lld bytes)\n"), lino, - INT_GET(dino->di_core.di_size, ARCH_CONVERT)); + be64_to_cpu(dino->di_core.di_size)); break; case XR_INO_FIFO: do_warn(_("size of fifo inode %llu !=3D 0 " "(%lld bytes)\n"), lino, - INT_GET(dino->di_core.di_size, ARCH_CONVERT)); + be64_to_cpu(dino->di_core.di_size)); break; default: do_warn(_("Internal error - process_misc_ino_types, " @@ -1769,712 +1768,395 @@ return (0); } = -/* - * returns 0 if the inode is ok, 1 if the inode is corrupt - * check_dups can be set to 1 *only* when called by the - * first pass of the duplicate block checking of phase 4. - * *dirty is set > 0 if the dinode has been altered and - * needs to be written out. - * - * for detailed, info, look at process_dinode() comments. - */ -/* ARGSUSED */ -int -process_dinode_int(xfs_mount_t *mp, - xfs_dinode_t *dino, - xfs_agnumber_t agno, - xfs_agino_t ino, - int was_free, /* 1 if inode is currently free */ - int *dirty, /* out =3D=3D > 0 if inode is now dirty */ - int *cleared, /* out =3D=3D 1 if inode was cleared */ - int *used, /* out =3D=3D 1 if inode is in use */ - int verify_mode, /* 1 =3D=3D verify but don't modify inode */ - int uncertain, /* 1 =3D=3D inode is uncertain */ - int ino_discovery, /* 1 =3D=3D check dirs for unknown inodes */ - int check_dups, /* 1 =3D=3D check if inode claims - * duplicate blocks */ - int extra_attr_check, /* 1 =3D=3D do attribute format and value check= s */ - int *isa_dir, /* out =3D=3D 1 if inode is a directory */ - xfs_ino_t *parent) /* out -- parent if ino is a dir */ +static inline int +dinode_fmt( + xfs_dinode_core_t *dinoc) { - xfs_drfsbno_t totblocks =3D 0; - xfs_drfsbno_t atotblocks =3D 0; - xfs_dinode_core_t *dinoc; - char *rstring; - int type; - int rtype; - int do_rt; - int err; - int retval =3D 0; - __uint64_t nextents; - __uint64_t anextents; - xfs_ino_t lino; - const int is_free =3D 0; - const int is_used =3D 1; - int repair =3D 0; - blkmap_t *ablkmap =3D NULL; - blkmap_t *dblkmap =3D NULL; - static char okfmts[] =3D { - 0, /* free inode */ - 1 << XFS_DINODE_FMT_DEV, /* FIFO */ - 1 << XFS_DINODE_FMT_DEV, /* CHR */ - 0, /* type 3 unused */ - (1 << XFS_DINODE_FMT_LOCAL) | - (1 << XFS_DINODE_FMT_EXTENTS) | - (1 << XFS_DINODE_FMT_BTREE), /* DIR */ - 0, /* type 5 unused */ - 1 << XFS_DINODE_FMT_DEV, /* BLK */ - 0, /* type 7 unused */ - (1 << XFS_DINODE_FMT_EXTENTS) | - (1 << XFS_DINODE_FMT_BTREE), /* REG */ - 0, /* type 9 unused */ - (1 << XFS_DINODE_FMT_LOCAL) | - (1 << XFS_DINODE_FMT_EXTENTS), /* LNK */ - 0, /* type 11 unused */ - 1 << XFS_DINODE_FMT_DEV, /* SOCK */ - 0, /* type 13 unused */ - 1 << XFS_DINODE_FMT_UUID, /* MNT */ - 0 /* type 15 unused */ - }; - - retval =3D 0; - totblocks =3D atotblocks =3D 0; - *dirty =3D *isa_dir =3D *cleared =3D 0; - *used =3D is_used; - type =3D rtype =3D XR_INO_UNKNOWN; - rstring =3D NULL; - do_rt =3D 0; + return be16_to_cpu(dinoc->di_mode) & S_IFMT; +} = - dinoc =3D &dino->di_core; - lino =3D XFS_AGINO_TO_INO(mp, agno, ino); +static inline void +change_dinode_fmt( + xfs_dinode_core_t *dinoc, + int new_fmt) +{ + int mode =3D be16_to_cpu(dinoc->di_mode); = - /* - * if in verify mode, don't modify the inode. - * - * if correcting, reset stuff that has known values - * - * if in uncertain mode, be silent on errors since we're - * trying to find out if these are inodes as opposed - * to assuming that they are. Just return the appropriate - * return code in that case. - */ + ASSERT((new_fmt & ~S_IFMT) =3D=3D 0); = - if (INT_GET(dinoc->di_magic, ARCH_CONVERT) !=3D XFS_DINODE_MAGIC) { - retval++; - if (!verify_mode) { - do_warn(_("bad magic number 0x%x on inode %llu, "), - INT_GET(dinoc->di_magic, ARCH_CONVERT), lino); + mode &=3D ~S_IFMT; + mode |=3D new_fmt; + dinoc->di_mode =3D cpu_to_be16(mode); +} + +static int +check_dinode_mode_format( + xfs_dinode_core_t *dinoc) +{ + if ((uchar_t)dinoc->di_format >=3D XFS_DINODE_FMT_UUID) + return -1; /* FMT_UUID is not used */ + + switch (dinode_fmt(dinoc)) { + case S_IFIFO: + case S_IFCHR: + case S_IFBLK: + case S_IFSOCK: + return (dinoc->di_format !=3D XFS_DINODE_FMT_DEV) ? -1 : 0; + + case S_IFDIR: + return (dinoc->di_format < XFS_DINODE_FMT_LOCAL || + dinoc->di_format > XFS_DINODE_FMT_BTREE) ? -1 : 0; + + case S_IFREG: + return (dinoc->di_format < XFS_DINODE_FMT_EXTENTS || + dinoc->di_format > XFS_DINODE_FMT_BTREE) ? -1 : 0; + + case S_IFLNK: + return (dinoc->di_format < XFS_DINODE_FMT_LOCAL || + dinoc->di_format > XFS_DINODE_FMT_EXTENTS) ? -1 : 0; + + default: ; + } + return 0; /* invalid modes are checked elsewhere */ +} + +/* + * If inode is a superblock inode, does type check to make sure is it v= alid. + * Returns 0 if it's valid, non-zero if it needs to be cleared. + */ + +static int +process_check_sb_inodes( + xfs_mount_t *mp, + xfs_dinode_core_t *dinoc, + xfs_ino_t lino, + int *type, + int *dirty) +{ + if (lino =3D=3D mp->m_sb.sb_rootino) { + if (*type !=3D XR_INO_DIR) { + do_warn(_("root inode %llu has bad type 0x%x\n"), + lino, dinode_fmt(dinoc)); + *type =3D XR_INO_DIR; if (!no_modify) { - do_warn(_("resetting magic number\n")); + do_warn(_("resetting to directory\n")); + change_dinode_fmt(dinoc, S_IFDIR); *dirty =3D 1; - INT_SET(dinoc->di_magic, ARCH_CONVERT, - XFS_DINODE_MAGIC); - } else { - do_warn(_("would reset magic number\n")); - } - } else if (!uncertain) { - do_warn(_("bad magic number 0x%x on inode %llu\n"), - INT_GET(dinoc->di_magic, ARCH_CONVERT), lino); + } else + do_warn(_("would reset to directory\n")); } + return 0; } - - if (!XFS_DINODE_GOOD_VERSION(dinoc->di_version) || - (!fs_inode_nlink && dinoc->di_version > XFS_DINODE_VERSION_1)) { - retval++; - if (!verify_mode) { - do_warn(_("bad version number 0x%x on inode %llu, "), - dinoc->di_version, lino); + if (lino =3D=3D mp->m_sb.sb_uquotino) { + if (*type !=3D XR_INO_DATA) { + do_warn(_("user quota inode %llu has bad type 0x%x\n"), + lino, dinode_fmt(dinoc)); + mp->m_sb.sb_uquotino =3D NULLFSINO; + return 1; + } + return 0; + } + if (lino =3D=3D mp->m_sb.sb_gquotino) { + if (*type !=3D XR_INO_DATA) { + do_warn(_("group quota inode %llu has bad type 0x%x\n"), + lino, dinode_fmt(dinoc)); + mp->m_sb.sb_gquotino =3D NULLFSINO; + return 1; + } + return 0; + } + if (lino =3D=3D mp->m_sb.sb_rsumino) { + if (*type !=3D XR_INO_RTSUM) { + do_warn(_("realtime summary inode %llu has bad type 0x%x, "), + lino, dinode_fmt(dinoc)); if (!no_modify) { - do_warn(_("resetting version number\n")); + do_warn(_("resetting to regular file\n")); + change_dinode_fmt(dinoc, S_IFREG); *dirty =3D 1; - dinoc->di_version =3D (fs_inode_nlink) ? - XFS_DINODE_VERSION_2 : - XFS_DINODE_VERSION_1; } else { - do_warn(_("would reset version number\n")); + do_warn(_("would reset to regular file\n")); } - } else if (!uncertain) { - do_warn(_("bad version number 0x%x on inode %llu\n"), - dinoc->di_version, lino); } + if (mp->m_sb.sb_rblocks =3D=3D 0 && dinoc->di_nextents !=3D 0) { + do_warn(_("bad # of extents (%u) for realtime summary inode %llu\n")= , + be32_to_cpu(dinoc->di_nextents), lino); + return 1; + } + return 0; } - - /* - * blow out of here if the inode size is < 0 - */ - if (INT_GET(dinoc->di_size, ARCH_CONVERT) < 0) { - retval++; - if (!verify_mode) { - do_warn(_("bad (negative) size %lld on inode %llu\n"), - INT_GET(dinoc->di_size, ARCH_CONVERT), lino); + if (lino =3D=3D mp->m_sb.sb_rbmino) { + if (*type !=3D XR_INO_RTBITMAP) { + do_warn(_("realtime bitmap inode %llu has bad type 0x%x, "), + lino, dinode_fmt(dinoc)); if (!no_modify) { - *dirty +=3D clear_dinode(mp, dino, lino); - *cleared =3D 1; - } else { + do_warn(_("resetting to regular file\n")); + change_dinode_fmt(dinoc, S_IFREG); *dirty =3D 1; - *cleared =3D 1; + } else { + do_warn(_("would reset to regular file\n")); } - *used =3D is_free; - } else if (!uncertain) { - do_warn(_("bad (negative) size %lld on inode %llu\n"), - INT_GET(dinoc->di_size, ARCH_CONVERT), lino); } - - return(1); - } - - /* - * was_free value is not meaningful if we're in verify mode - */ - if (!verify_mode && INT_GET(dinoc->di_mode, ARCH_CONVERT) =3D=3D 0 && = was_free =3D=3D 1) { - /* - * easy case, inode free -- inode and map agree, clear - * it just in case to ensure that format, etc. are - * set correctly - */ - if (!no_modify) { - err =3D clear_dinode(mp, dino, lino); - if (err) { - *dirty =3D 1; - *cleared =3D 1; - } + if (mp->m_sb.sb_rblocks =3D=3D 0 && dinoc->di_nextents !=3D 0) { + do_warn(_("bad # of extents (%u) for realtime bitmap inode %llu\n"),= + be32_to_cpu(dinoc->di_nextents), lino); + return 1; } - *used =3D is_free; - return(0); - } else if (!verify_mode && INT_GET(dinoc->di_mode, ARCH_CONVERT) =3D=3D= 0 && was_free =3D=3D 0) { - /* - * the inode looks free but the map says it's in use. - * clear the inode just to be safe and mark the inode - * free. - */ - do_warn(_("imap claims a free inode %llu is in use, "), lino); + return 0; + } + return 0; +} = - if (!no_modify) { - do_warn(_("correcting imap and clearing inode\n")); +/* + * general size/consistency checks: + * + * if the size <=3D size of the data fork, directories must be + * local inodes unlike regular files which would be extent inodes. + * all the other mentioned types have to have a zero size value. + * + * if the size and format don't match, get out now rather than + * risk trying to process a non-existent extents or btree + * type data fork. + */ +static int +process_check_inode_sizes( + xfs_mount_t *mp, + xfs_dinode_t *dino, + xfs_ino_t lino, + int type) +{ + xfs_dinode_core_t *dinoc =3D &dino->di_core; + xfs_fsize_t size =3D be64_to_cpu(dinoc->di_size); = - err =3D clear_dinode(mp, dino, lino); - if (err) { - retval++; - *dirty =3D 1; - *cleared =3D 1; - } - } else { - do_warn(_("would correct imap and clear inode\n")); + switch (type) { = - *dirty =3D 1; - *cleared =3D 1; + case XR_INO_DIR: + if (size <=3D XFS_DFORK_DSIZE(dino, mp) && + dinoc->di_format !=3D XFS_DINODE_FMT_LOCAL) { + do_warn(_("mismatch between format (%d) and size " + "(%lld) in directory ino %llu\n"), + dinoc->di_format, size, lino); + return 1; } + break; = - *used =3D is_free; - - return(retval > 0 ? 1 : 0); - } - - /* - * because of the lack of any write ordering guarantee, it's - * possible that the core got updated but the forks didn't. - * so rather than be ambitious (and probably incorrect), - * if there's an inconsistency, we get conservative and - * just pitch the file. blow off checking formats of - * free inodes since technically any format is legal - * as we reset the inode when we re-use it. - */ - if (INT_GET(dinoc->di_mode, ARCH_CONVERT) !=3D 0 && - ((((INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT) >> 12) > 15) || - (uchar_t) dinoc->di_format > XFS_DINODE_FMT_UUID || - (!(okfmts[(INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT) >> 12] & - (1 << dinoc->di_format))))) { - /* bad inode format */ - retval++; - if (!uncertain) - do_warn(_("bad inode format in inode %llu\n"), lino); - if (!verify_mode) { - if (!no_modify) { - *dirty +=3D clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } + case XR_INO_SYMLINK: + if (process_symlink_extlist(mp, lino, dino)) { + do_warn(_("bad data fork in symlink %llu\n"), lino); + return 1; } - *cleared =3D 1; - *used =3D is_free; - - return(retval > 0 ? 1 : 0); - } - - if (verify_mode) - return(retval > 0 ? 1 : 0); - - /* - * clear the next unlinked field if necessary on a good - * inode only during phase 4 -- when checking for inodes - * referencing duplicate blocks. then it's safe because - * we've done the inode discovery and have found all the inodes - * we're going to find. check_dups is set to 1 only during - * phase 4. Ugly. - */ - if (check_dups && !no_modify) - *dirty +=3D clear_dinode_unlinked(mp, dino); - - /* set type and map type info */ + break; = - switch (INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT) { - case S_IFDIR: - type =3D XR_INO_DIR; - *isa_dir =3D 1; + case XR_INO_CHRDEV: /* fall through to FIFO case ... */ + case XR_INO_BLKDEV: /* fall through to FIFO case ... */ + case XR_INO_SOCK: /* fall through to FIFO case ... */ + case XR_INO_MOUNTPOINT: /* fall through to FIFO case ... */ + case XR_INO_FIFO: + if (process_misc_ino_types(mp, dino, lino, type)) + return 1; break; - case S_IFREG: - if (INT_GET(dinoc->di_flags, ARCH_CONVERT) & XFS_DIFLAG_REALTIME) - type =3D XR_INO_RTDATA; - else if (lino =3D=3D mp->m_sb.sb_rbmino) - type =3D XR_INO_RTBITMAP; - else if (lino =3D=3D mp->m_sb.sb_rsumino) - type =3D XR_INO_RTSUM; - else - type =3D XR_INO_DATA; + + case XR_INO_RTDATA: + /* + * if we have no realtime blocks, any inode claiming + * to be a real-time file is bogus + */ + if (mp->m_sb.sb_rblocks =3D=3D 0) { + do_warn(_("found inode %llu claiming to be a " + "real-time file\n"), lino); + return 1; + } break; - case S_IFLNK: - type =3D XR_INO_SYMLINK; + + case XR_INO_RTBITMAP: + if (size !=3D (__int64_t)mp->m_sb.sb_rbmblocks * + mp->m_sb.sb_blocksize) { + do_warn(_("realtime bitmap inode %llu has bad size " + "%lld (should be %lld)\n"), + lino, size, (__int64_t) mp->m_sb.sb_rbmblocks * + mp->m_sb.sb_blocksize); + return 1; + } break; - case S_IFCHR: - type =3D XR_INO_CHRDEV; + + case XR_INO_RTSUM: + if (size !=3D mp->m_rsumsize) { + do_warn(_("realtime summary inode %llu has bad size " + "%lld (should be %d)\n"), + lino, size, mp->m_rsumsize); + return 1; + } break; - case S_IFBLK: - type =3D XR_INO_BLKDEV; + + default: break; - case S_IFSOCK: - type =3D XR_INO_SOCK; + } + return 0; +} + +/* + * check for illegal values of forkoff + */ +static int +process_check_inode_forkoff( + xfs_mount_t *mp, + xfs_dinode_core_t *dinoc, + xfs_ino_t lino) +{ + if (dinoc->di_forkoff =3D=3D 0) + return 0; + + switch (dinoc->di_format) { + case XFS_DINODE_FMT_DEV: + if (dinoc->di_forkoff !=3D (roundup(sizeof(xfs_dev_t), 8) >> 3)) { + do_warn(_("bad attr fork offset %d in dev inode %llu, " + "should be %d\n"), dinoc->di_forkoff, lino, + (int)(roundup(sizeof(xfs_dev_t), 8) >> 3)); + return 1; + } break; - case S_IFIFO: - type =3D XR_INO_FIFO; + case XFS_DINODE_FMT_LOCAL: /* fall through ... */ + case XFS_DINODE_FMT_EXTENTS: /* fall through ... */ + case XFS_DINODE_FMT_BTREE: + if (dinoc->di_forkoff >=3D (XFS_LITINO(mp) >> 3)) { + do_warn(_("bad attr fork offset %d in inode %llu, " + "max=3D%d\n"), dinoc->di_forkoff, lino, + XFS_LITINO(mp) >> 3); + return 1; + } break; default: - retval++; - if (!verify_mode) { - do_warn(_("bad inode type %#o inode %llu\n"), - (int) (INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT), lino); - if (!no_modify) - *dirty +=3D clear_dinode(mp, dino, lino); - else - *dirty =3D 1; - *cleared =3D 1; - *used =3D is_free; - } else if (!uncertain) { - do_warn(_("bad inode type %#o inode %llu\n"), - (int) (INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT), lino); - } - return 1; + do_error(_("unexpected inode format %d\n"), dinoc->di_format); + break; } + return 0; +} = - /* - * type checks for root, realtime inodes, and quota inodes - */ - if (lino =3D=3D mp->m_sb.sb_rootino && type !=3D XR_INO_DIR) { - do_warn(_("bad inode type for root inode %llu, "), lino); - type =3D XR_INO_DIR; - +/* + * Updates the inodes block and extent counts if they are wrong + */ +static int +process_inode_blocks_and_extents( + xfs_dinode_core_t *dinoc, + xfs_drfsbno_t nblocks, + __uint64_t nextents, + __uint64_t anextents, + xfs_ino_t lino, + int *dirty) +{ + if (nblocks !=3D be64_to_cpu(dinoc->di_nblocks)) { if (!no_modify) { - do_warn(_("resetting to directory\n")); - INT_MOD_EXPR(dinoc->di_mode, ARCH_CONVERT, - &=3D ~(INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT)); - INT_MOD_EXPR(dinoc->di_mode, ARCH_CONVERT, - |=3D INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFDIR); + do_warn(_("correcting nblocks for inode %llu, " + "was %llu - counted %llu\n"), lino, + be64_to_cpu(dinoc->di_nblocks), nblocks); + dinoc->di_nblocks =3D cpu_to_be64(nblocks); + *dirty =3D 1; } else { - do_warn(_("would reset to directory\n")); + do_warn(_("bad nblocks %llu for inode %llu, " + "would reset to %llu\n"), + be64_to_cpu(dinoc->di_nblocks), lino, nblocks); } - } else if (lino =3D=3D mp->m_sb.sb_rsumino) { - do_rt =3D 1; - rstring =3D _("summary"); - rtype =3D XR_INO_RTSUM; - } else if (lino =3D=3D mp->m_sb.sb_rbmino) { - do_rt =3D 1; - rstring =3D _("bitmap"); - rtype =3D XR_INO_RTBITMAP; - } else if (lino =3D=3D mp->m_sb.sb_uquotino) { - if (type !=3D XR_INO_DATA) { - do_warn(_("user quota inode has bad type 0x%x\n"), - INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT); + } = - if (!no_modify) { - *dirty +=3D clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - - mp->m_sb.sb_uquotino =3D NULLFSINO; - - return(1); - } - } else if (lino =3D=3D mp->m_sb.sb_gquotino) { - if (type !=3D XR_INO_DATA) { - do_warn(_("group quota inode has bad type 0x%x\n"), - INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT); - - if (!no_modify) { - *dirty +=3D clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - - mp->m_sb.sb_gquotino =3D NULLFSINO; - - return(1); - } + if (nextents > MAXEXTNUM) { + do_warn(_("too many data fork extents (%llu) in inode %llu\n"), + nextents, lino); + return 1; } - - if (do_rt && type !=3D rtype) { - type =3D XR_INO_DATA; - - do_warn(_("bad inode type for realtime %s inode %llu, "), - rstring, lino); - + if (nextents !=3D be32_to_cpu(dinoc->di_nextents)) { if (!no_modify) { - do_warn(_("resetting to regular file\n")); - INT_MOD_EXPR(dinoc->di_mode, ARCH_CONVERT, - &=3D ~(INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT)); - INT_MOD_EXPR(dinoc->di_mode, ARCH_CONVERT, - |=3D INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFREG); + do_warn(_("correcting nextents for inode %llu, " + "was %d - counted %llu\n"), lino, + be32_to_cpu(dinoc->di_nextents), nextents); + dinoc->di_nextents =3D cpu_to_be32(nextents); + *dirty =3D 1; } else { - do_warn(_("would reset to regular file\n")); - } - } - - /* - * only regular files with REALTIME or EXTSIZE flags set can have - * extsize set, or directories with EXTSZINHERIT. - */ - if (INT_GET(dinoc->di_extsize, ARCH_CONVERT) !=3D 0) { - if ((type =3D=3D XR_INO_RTDATA) || - (type =3D=3D XR_INO_DIR && - (INT_GET(dinoc->di_flags, ARCH_CONVERT) & - XFS_DIFLAG_EXTSZINHERIT)) || - (type =3D=3D XR_INO_DATA && - (INT_GET(dinoc->di_flags, ARCH_CONVERT) & - XFS_DIFLAG_EXTSIZE))) { - /* s'okay */ ; - } else { - do_warn( - _("bad non-zero extent size %u for non-realtime/extsize inode %llu, ")= , - INT_GET(dinoc->di_extsize, ARCH_CONVERT), lino); - - if (!no_modify) { - do_warn(_("resetting to zero\n")); - dinoc->di_extsize =3D 0; - *dirty =3D 1; - } else { - do_warn(_("would reset to zero\n")); - } + do_warn(_("bad nextents %d for inode %llu, would reset " + "to %llu\n"), be32_to_cpu(dinoc->di_nextents), + lino, nextents); } } = - /* - * for realtime inodes, check sizes to see that - * they are consistent with the # of realtime blocks. - * also, verify that they contain only one extent and - * are extent format files. If anything's wrong, clear - * the inode -- we'll recreate it in phase 6. - */ - if (do_rt && - ((lino =3D=3D mp->m_sb.sb_rbmino && - INT_GET(dinoc->di_size, ARCH_CONVERT) - !=3D mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize) || - (lino =3D=3D mp->m_sb.sb_rsumino && - INT_GET(dinoc->di_size, ARCH_CONVERT) !=3D mp->m_rsumsize))) { - - do_warn(_("bad size %llu for realtime %s inode %llu\n"), - INT_GET(dinoc->di_size, ARCH_CONVERT), rstring, lino); - - if (!no_modify) { - *dirty +=3D clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - - return(1); + if (anextents > MAXAEXTNUM) { + do_warn(_("too many attr fork extents (%llu) in inode %llu\n"), + anextents, lino); + return 1; } - - if (do_rt && mp->m_sb.sb_rblocks =3D=3D 0 && INT_GET(dinoc->di_nextent= s, ARCH_CONVERT) !=3D 0) { - do_warn(_("bad # of extents (%u) for realtime %s inode %llu\n"), - INT_GET(dinoc->di_nextents, ARCH_CONVERT), rstring, lino); - + if (anextents !=3D be16_to_cpu(dinoc->di_anextents)) { if (!no_modify) { - *dirty +=3D clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - - return(1); - } - - /* - * Setup nextents and anextents for blkmap_alloc calls. - */ - nextents =3D INT_GET(dinoc->di_nextents, ARCH_CONVERT); - if (nextents > INT_GET(dinoc->di_nblocks, ARCH_CONVERT) || nextents > = XFS_MAX_INCORE_EXTENTS) - nextents =3D 1; - anextents =3D INT_GET(dinoc->di_anextents, ARCH_CONVERT); - if (anextents > INT_GET(dinoc->di_nblocks, ARCH_CONVERT) || anextents = > XFS_MAX_INCORE_EXTENTS) - anextents =3D 1; - - /* - * general size/consistency checks: - * - * if the size <=3D size of the data fork, directories must be - * local inodes unlike regular files which would be extent inodes. - * all the other mentioned types have to have a zero size value. - * - * if the size and format don't match, get out now rather than - * risk trying to process a non-existent extents or btree - * type data fork. - */ - switch (type) { - case XR_INO_DIR: - if (INT_GET(dinoc->di_size, ARCH_CONVERT) <=3D - XFS_DFORK_DSIZE(dino, mp) && - (dinoc->di_format !=3D XFS_DINODE_FMT_LOCAL)) { - do_warn( -_("mismatch between format (%d) and size (%lld) in directory ino %llu\n= "), - dinoc->di_format, - INT_GET(dinoc->di_size, ARCH_CONVERT), - lino); - - if (!no_modify) { - *dirty +=3D clear_dinode(mp, - dino, lino); - ASSERT(*dirty > 0); - } - - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - - return(1); - } - if (dinoc->di_format !=3D XFS_DINODE_FMT_LOCAL) - dblkmap =3D blkmap_alloc(nextents); - break; - case XR_INO_SYMLINK: - if (process_symlink_extlist(mp, lino, dino)) { - do_warn(_("bad data fork in symlink %llu\n"), lino); - - if (!no_modify) { - *dirty +=3D clear_dinode(mp, - dino, lino); - ASSERT(*dirty > 0); - } - - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - - return(1); - } - if (dinoc->di_format !=3D XFS_DINODE_FMT_LOCAL) - dblkmap =3D blkmap_alloc(nextents); - break; - case XR_INO_CHRDEV: /* fall through to FIFO case ... */ - case XR_INO_BLKDEV: /* fall through to FIFO case ... */ - case XR_INO_SOCK: /* fall through to FIFO case ... */ - case XR_INO_MOUNTPOINT: /* fall through to FIFO case ... */ - case XR_INO_FIFO: - if (process_misc_ino_types(mp, dino, lino, type)) { - if (!no_modify) { - *dirty +=3D clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - - return(1); - } - break; - case XR_INO_RTDATA: - /* - * if we have no realtime blocks, any inode claiming - * to be a real-time file is bogus - */ - if (mp->m_sb.sb_rblocks =3D=3D 0) { - do_warn( - _("found inode %llu claiming to be a real-time file\n"), - lino); - - if (!no_modify) { - *dirty +=3D clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - - return(1); - } - break; - case XR_INO_RTBITMAP: - if (INT_GET(dinoc->di_size, ARCH_CONVERT) !=3D - (__int64_t)mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize) { - do_warn( - _("realtime bitmap inode %llu has bad size %lld (should be %lld)\n"), - lino, INT_GET(dinoc->di_size, ARCH_CONVERT), - (__int64_t) mp->m_sb.sb_rbmblocks * - mp->m_sb.sb_blocksize); - - if (!no_modify) { - *dirty +=3D clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - - return(1); - } - dblkmap =3D blkmap_alloc(nextents); - break; - case XR_INO_RTSUM: - if (INT_GET(dinoc->di_size, ARCH_CONVERT) !=3D mp->m_rsumsize) { - do_warn( - _("realtime summary inode %llu has bad size %lld (should be %d)\n"), - lino, INT_GET(dinoc->di_size, ARCH_CONVERT), - mp->m_rsumsize); - - if (!no_modify) { - *dirty +=3D clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - - return(1); - } - dblkmap =3D blkmap_alloc(nextents); - break; - default: - break; - } - - /* - * check for illegal values of forkoff - */ - err =3D 0; - if (dinoc->di_forkoff !=3D 0) { - switch (dinoc->di_format) { - case XFS_DINODE_FMT_DEV: - if (dinoc->di_forkoff !=3D - (roundup(sizeof(xfs_dev_t), 8) >> 3)) { - do_warn( - _("bad attr fork offset %d in dev inode %llu, should be %d\n"), - (int) dinoc->di_forkoff, - lino, - (int) (roundup(sizeof(xfs_dev_t), 8) >> 3)); - err =3D 1; - } - break; - case XFS_DINODE_FMT_UUID: - if (dinoc->di_forkoff !=3D - (roundup(sizeof(uuid_t), 8) >> 3)) { - do_warn( - _("bad attr fork offset %d in uuid inode %llu, should be %d\n"), - (int) dinoc->di_forkoff, - lino, - (int)(roundup(sizeof(uuid_t), 8) >> 3)); - err =3D 1; - } - break; - case XFS_DINODE_FMT_LOCAL: /* fall through ... */ - case XFS_DINODE_FMT_EXTENTS: /* fall through ... */ - case XFS_DINODE_FMT_BTREE: { - if (dinoc->di_forkoff >=3D (XFS_LITINO(mp) >> 3)) { - do_warn( - _("bad attr fork offset %d in inode %llu, max=3D%d\n"), - (int) dinoc->di_forkoff, - lino, XFS_LITINO(mp) >> 3); - err =3D 1; - } - break; - } - default: - do_error(_("unexpected inode format %d\n"), - (int) dinoc->di_format); - break; + do_warn(_("correcting anextents for inode %llu, " + "was %d - counted %llu\n"), lino, + be16_to_cpu(dinoc->di_anextents), anextents); + dinoc->di_anextents =3D cpu_to_be16(anextents); + *dirty =3D 1; + } else { + do_warn(_("bad anextents %d for inode %llu, would reset" + " to %llu\n"), be16_to_cpu(dinoc->di_anextents), + lino, anextents); } } + return 0; +} = - if (err) { - if (!no_modify) { - *dirty +=3D clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } +/* + * check data fork -- if it's bad, clear the inode + */ +static int +process_inode_data_fork( + xfs_mount_t *mp, + xfs_agnumber_t agno, + xfs_agino_t ino, + xfs_dinode_t *dino, + int type, + int *dirty, + xfs_drfsbno_t *totblocks, + __uint64_t *nextents, + blkmap_t **dblkmap, + int check_dups) +{ + xfs_dinode_core_t *dinoc =3D &dino->di_core; + xfs_ino_t lino =3D XFS_AGINO_TO_INO(mp, agno, ino); + int err =3D 0; = - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - blkmap_free(dblkmap); - return(1); - } + *nextents =3D be32_to_cpu(dinoc->di_nextents); + if (*nextents > be64_to_cpu(dinoc->di_nblocks) || + *nextents > XFS_MAX_INCORE_EXTENTS) + *nextents =3D 1; + + if (dinoc->di_format !=3D XFS_DINODE_FMT_LOCAL && type !=3D XR_INO_RTD= ATA) + *dblkmap =3D blkmap_alloc(*nextents); + *nextents =3D 0; = - /* - * check data fork -- if it's bad, clear the inode - */ - nextents =3D 0; switch (dinoc->di_format) { case XFS_DINODE_FMT_LOCAL: - err =3D process_lclinode(mp, agno, ino, dino, type, - dirty, &totblocks, &nextents, &dblkmap, - XFS_DATA_FORK, check_dups); + err =3D process_lclinode(mp, agno, ino, dino, type, dirty, + totblocks, nextents, dblkmap, XFS_DATA_FORK, + check_dups); break; case XFS_DINODE_FMT_EXTENTS: - err =3D process_exinode(mp, agno, ino, dino, type, - dirty, &totblocks, &nextents, &dblkmap, - XFS_DATA_FORK, check_dups); + err =3D process_exinode(mp, agno, ino, dino, type, dirty, + totblocks, nextents, dblkmap, XFS_DATA_FORK, + check_dups); break; case XFS_DINODE_FMT_BTREE: - err =3D process_btinode(mp, agno, ino, dino, type, - dirty, &totblocks, &nextents, &dblkmap, - XFS_DATA_FORK, check_dups); + err =3D process_btinode(mp, agno, ino, dino, type, dirty, + totblocks, nextents, dblkmap, XFS_DATA_FORK, + check_dups); break; case XFS_DINODE_FMT_DEV: /* fall through */ - case XFS_DINODE_FMT_UUID: err =3D 0; break; default: do_error(_("unknown format %d, ino %llu (mode =3D %d)\n"), - dinoc->di_format, lino, - INT_GET(dinoc->di_mode, ARCH_CONVERT)); + dinoc->di_format, lino, be16_to_cpu(dinoc->di_mode)); } = if (err) { - /* - * problem in the data fork, clear out the inode - * and get out - */ do_warn(_("bad data fork in inode %llu\n"), lino); - if (!no_modify) { *dirty +=3D clear_dinode(mp, dino, lino); ASSERT(*dirty > 0); } - - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - blkmap_free(dblkmap); - return(1); + return 1; } = if (check_dups) { @@ -2486,465 +2168,635 @@ switch (dinoc->di_format) { case XFS_DINODE_FMT_LOCAL: err =3D process_lclinode(mp, agno, ino, dino, type, - dirty, &totblocks, &nextents, &dblkmap, + dirty, totblocks, nextents, dblkmap, XFS_DATA_FORK, 0); break; case XFS_DINODE_FMT_EXTENTS: err =3D process_exinode(mp, agno, ino, dino, type, - dirty, &totblocks, &nextents, &dblkmap, + dirty, totblocks, nextents, dblkmap, XFS_DATA_FORK, 0); break; case XFS_DINODE_FMT_BTREE: err =3D process_btinode(mp, agno, ino, dino, type, - dirty, &totblocks, &nextents, &dblkmap, + dirty, totblocks, nextents, dblkmap, XFS_DATA_FORK, 0); break; case XFS_DINODE_FMT_DEV: /* fall through */ - case XFS_DINODE_FMT_UUID: err =3D 0; break; default: do_error(_("unknown format %d, ino %llu (mode =3D %d)\n"), dinoc->di_format, lino, - INT_GET(dinoc->di_mode, ARCH_CONVERT)); + be16_to_cpu(dinoc->di_mode)); } = - if (no_modify && err !=3D 0) { - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - blkmap_free(dblkmap); - return(1); - } + if (no_modify && err !=3D 0) + return 1; = ASSERT(err =3D=3D 0); } + return 0; +} = - /* - * check attribute fork if necessary. attributes are - * always stored in the regular filesystem. - */ +/* + * Process extended attribute fork in inode + */ +static int +process_inode_attr_fork( + xfs_mount_t *mp, + xfs_agnumber_t agno, + xfs_agino_t ino, + xfs_dinode_t *dino, + int type, + int *dirty, + xfs_drfsbno_t *atotblocks, + __uint64_t *anextents, + int check_dups, + int extra_attr_check, + int *retval) +{ + xfs_dinode_core_t *dinoc =3D &dino->di_core; + xfs_ino_t lino =3D XFS_AGINO_TO_INO(mp, agno, ino); + blkmap_t *ablkmap =3D NULL; + int repair =3D 0; + int err; + + if (!XFS_DFORK_Q(dino)) { + *anextents =3D 0; + if (dinoc->di_aformat !=3D XFS_DINODE_FMT_EXTENTS) { + do_warn(_("bad attribute format %d in inode %llu, "), + dinoc->di_aformat, lino); + if (!no_modify) { + do_warn(_("resetting value\n")); + dinoc->di_aformat =3D XFS_DINODE_FMT_EXTENTS; + *dirty =3D 1; + } else + do_warn(_("would reset value\n")); + } + return 0; + } = - if (!XFS_DFORK_Q(dino) && - dinoc->di_aformat !=3D XFS_DINODE_FMT_EXTENTS) { - do_warn(_("bad attribute format %d in inode %llu, "), - dinoc->di_aformat, lino); - if (!no_modify) { - do_warn(_("resetting value\n")); - dinoc->di_aformat =3D XFS_DINODE_FMT_EXTENTS; - *dirty =3D 1; - } else - do_warn(_("would reset value\n")); - anextents =3D 0; - } else if (XFS_DFORK_Q(dino)) { + *anextents =3D be16_to_cpu(dinoc->di_anextents); + if (*anextents > be64_to_cpu(dinoc->di_nblocks) || + *anextents > XFS_MAX_INCORE_EXTENTS) + *anextents =3D 1; + + switch (dinoc->di_aformat) { + case XFS_DINODE_FMT_LOCAL: + *anextents =3D 0; + err =3D process_lclinode(mp, agno, ino, dino, type, dirty, + atotblocks, anextents, &ablkmap, + XFS_ATTR_FORK, check_dups); + break; + case XFS_DINODE_FMT_EXTENTS: + ablkmap =3D blkmap_alloc(*anextents); + *anextents =3D 0; + err =3D process_exinode(mp, agno, ino, dino, type, dirty, + atotblocks, anextents, &ablkmap, + XFS_ATTR_FORK, check_dups); + break; + case XFS_DINODE_FMT_BTREE: + ablkmap =3D blkmap_alloc(*anextents); + *anextents =3D 0; + err =3D process_btinode(mp, agno, ino, dino, type, dirty, + atotblocks, anextents, &ablkmap, + XFS_ATTR_FORK, check_dups); + break; + default: + do_warn(_("illegal attribute format %d, ino %llu\n"), + dinoc->di_aformat, lino); + err =3D 1; + break; + } + + if (err) { + /* + * clear the attribute fork if necessary. we can't + * clear the inode because we've already put the + * inode space info into the blockmap. + * + * XXX - put the inode onto the "move it" list and + * log the the attribute scrubbing + */ + do_warn(_("bad attribute fork in inode %llu"), lino); + + if (!no_modify) { + if (delete_attr_ok) { + do_warn(_(", clearing attr fork\n")); + *dirty +=3D clear_dinode_attr(mp, dino, lino); + dinoc->di_aformat =3D XFS_DINODE_FMT_LOCAL; + } else { + do_warn("\n"); + *dirty +=3D clear_dinode(mp, dino, lino); + } + ASSERT(*dirty > 0); + } else { + do_warn(_(", would clear attr fork\n")); + } + + *atotblocks =3D 0; + *anextents =3D 0; + blkmap_free(ablkmap); + *retval =3D 1; + + return delete_attr_ok ? 0 : 1; + } + + if (check_dups) { switch (dinoc->di_aformat) { case XFS_DINODE_FMT_LOCAL: - anextents =3D 0; err =3D process_lclinode(mp, agno, ino, dino, - type, dirty, &atotblocks, &anextents, &ablkmap, - XFS_ATTR_FORK, check_dups); + type, dirty, atotblocks, anextents, + &ablkmap, XFS_ATTR_FORK, 0); break; case XFS_DINODE_FMT_EXTENTS: - ablkmap =3D blkmap_alloc(anextents); - anextents =3D 0; err =3D process_exinode(mp, agno, ino, dino, - type, dirty, &atotblocks, &anextents, &ablkmap, - XFS_ATTR_FORK, check_dups); + type, dirty, atotblocks, anextents, + &ablkmap, XFS_ATTR_FORK, 0); break; case XFS_DINODE_FMT_BTREE: - ablkmap =3D blkmap_alloc(anextents); - anextents =3D 0; err =3D process_btinode(mp, agno, ino, dino, - type, dirty, &atotblocks, &anextents, &ablkmap, - XFS_ATTR_FORK, check_dups); + type, dirty, atotblocks, anextents, + &ablkmap, XFS_ATTR_FORK, 0); break; default: - anextents =3D 0; - do_warn(_("illegal attribute format %d, ino %llu\n"), - dinoc->di_aformat, lino); - err =3D 1; - break; + do_error(_("illegal attribute fmt %d, ino %llu\n"), + dinoc->di_aformat, lino); } = - if (err) { - /* - * clear the attribute fork if necessary. we can't - * clear the inode because we've already put the - * inode space info into the blockmap. - * - * XXX - put the inode onto the "move it" list and - * log the the attribute scrubbing - */ - do_warn(_("bad attribute fork in inode %llu"), lino); + if (no_modify && err !=3D 0) { + blkmap_free(ablkmap); + return 1; + } = + ASSERT(err =3D=3D 0); + } + + /* + * do attribute semantic-based consistency checks now + */ + + /* get this only in phase 3, not in both phase 3 and 4 */ + if (extra_attr_check && + process_attributes(mp, lino, dino, ablkmap, &repair)) { + do_warn(_("problem with attribute contents in inode %llu\n"), + lino); + if (!repair) { + /* clear attributes if not done already */ if (!no_modify) { - if (delete_attr_ok) { - do_warn(_(", clearing attr fork\n")); - *dirty +=3D clear_dinode_attr(mp, - dino, lino); - } else { - do_warn("\n"); - *dirty +=3D clear_dinode(mp, - dino, lino); - } - ASSERT(*dirty > 0); + *dirty +=3D clear_dinode_attr(mp, dino, lino); + dinoc->di_aformat =3D XFS_DINODE_FMT_LOCAL; } else { - do_warn(_(", would clear attr fork\n")); + do_warn(_("would clear attr fork\n")); } + *atotblocks =3D 0; + *anextents =3D 0; + } + else { + *dirty =3D 1; /* it's been repaired */ + } + } + blkmap_free(ablkmap); + return 0; +} = - atotblocks =3D 0; - anextents =3D 0; +/* + * check nlinks feature, if it's a version 1 inode, + * just leave nlinks alone. even if it's set wrong, + * it'll be reset when read in. + */ = - if (delete_attr_ok) { - if (!no_modify) - dinoc->di_aformat =3D XFS_DINODE_FMT_LOCAL; +static int +process_check_inode_nlink_version( + xfs_dinode_core_t *dinoc, + xfs_ino_t lino) +{ + int dirty =3D 0; + + if (dinoc->di_version > XFS_DINODE_VERSION_1 && !fs_inode_nlink) { + /* + * do we have a fs/inode version mismatch with a valid + * version 2 inode here that has to stay version 2 or + * lose links? + */ + if (be32_to_cpu(dinoc->di_nlink) > XFS_MAXLINK_1) { + /* + * yes. are nlink inodes allowed? + */ + if (fs_inode_nlink_allowed) { + /* + * yes, update status variable which will + * cause sb to be updated later. + */ + fs_inode_nlink =3D 1; + do_warn(_("version 2 inode %llu claims > %u links, "), + lino, XFS_MAXLINK_1); + if (!no_modify) { + do_warn(_("updating superblock " + "version number\n")); + } else { + do_warn(_("would update superblock " + "version number\n")); + } } else { - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - blkmap_free(dblkmap); - blkmap_free(ablkmap); + /* + * no, have to convert back to onlinks + * even if we lose some links + */ + do_warn(_("WARNING: version 2 inode %llu " + "claims > %u links, "), + lino, XFS_MAXLINK_1); + if (!no_modify) { + do_warn(_("converting back to version 1,\n" + "this may destroy %d links\n"), + be32_to_cpu(dinoc->di_nlink) - + XFS_MAXLINK_1); + + dinoc->di_version =3D XFS_DINODE_VERSION_1; + dinoc->di_nlink =3D cpu_to_be32(XFS_MAXLINK_1); + dinoc->di_onlink =3D cpu_to_be16(XFS_MAXLINK_1); + dirty =3D 1; + } else { + do_warn(_("would convert back to version 1,\n" + "\tthis might destroy %d links\n"), + be32_to_cpu(dinoc->di_nlink) - + XFS_MAXLINK_1); + } } - return(1); - - } else if (check_dups) { - switch (dinoc->di_aformat) { - case XFS_DINODE_FMT_LOCAL: - err =3D process_lclinode(mp, agno, ino, dino, - type, dirty, &atotblocks, &anextents, - &ablkmap, XFS_ATTR_FORK, 0); - break; - case XFS_DINODE_FMT_EXTENTS: - err =3D process_exinode(mp, agno, ino, dino, - type, dirty, &atotblocks, &anextents, - &ablkmap, XFS_ATTR_FORK, 0); - break; - case XFS_DINODE_FMT_BTREE: - err =3D process_btinode(mp, agno, ino, dino, - type, dirty, &atotblocks, &anextents, - &ablkmap, XFS_ATTR_FORK, 0); - break; - default: - do_error( - _("illegal attribute fmt %d, ino %llu\n"), - dinoc->di_aformat, lino); + } else { + /* + * do we have a v2 inode that we could convert back + * to v1 without losing any links? if we do and + * we have a mismatch between superblock bits and the + * version bit, alter the version bit in this case. + * + * the case where we lost links was handled above. + */ + do_warn(_("found version 2 inode %llu, "), lino); + if (!no_modify) { + do_warn(_("converting back to version 1\n")); + dinoc->di_version =3D XFS_DINODE_VERSION_1; + dinoc->di_onlink =3D cpu_to_be16( + be32_to_cpu(dinoc->di_nlink)); + dirty =3D 1; + } else { + do_warn(_("would convert back to version 1\n")); } + } + } + + /* + * ok, if it's still a version 2 inode, it's going + * to stay a version 2 inode. it should have a zero + * onlink field, so clear it. + */ + if (dinoc->di_version > XFS_DINODE_VERSION_1 && + dinoc->di_onlink !=3D 0 && fs_inode_nlink > 0) { + if (!no_modify) { + do_warn(_("clearing obsolete nlink field in " + "version 2 inode %llu, was %d, now 0\n"), + lino, be16_to_cpu(dinoc->di_onlink)); + dinoc->di_onlink =3D 0; + dirty =3D 1; + } else { + do_warn(_("would clear obsolete nlink field in " + "version 2 inode %llu, currently %d\n"), + lino, be16_to_cpu(dinoc->di_onlink)); + } + } + return dirty; +} + +/* + * returns 0 if the inode is ok, 1 if the inode is corrupt + * check_dups can be set to 1 *only* when called by the + * first pass of the duplicate block checking of phase 4. + * *dirty is set > 0 if the dinode has been altered and + * needs to be written out. + * + * for detailed, info, look at process_dinode() comments. + */ +/* ARGSUSED */ +int +process_dinode_int(xfs_mount_t *mp, + xfs_dinode_t *dino, + xfs_agnumber_t agno, + xfs_agino_t ino, + int was_free, /* 1 if inode is currently free */ + int *dirty, /* out =3D=3D > 0 if inode is now dirty */ + int *used, /* out =3D=3D 1 if inode is in use */ + int verify_mode, /* 1 =3D=3D verify but don't modify inode */ + int uncertain, /* 1 =3D=3D inode is uncertain */ + int ino_discovery, /* 1 =3D=3D check dirs for unknown inodes */ + int check_dups, /* 1 =3D=3D check if inode claims + * duplicate blocks */ + int extra_attr_check, /* 1 =3D=3D do attribute format and value check= s */ + int *isa_dir, /* out =3D=3D 1 if inode is a directory */ + xfs_ino_t *parent) /* out -- parent if ino is a dir */ +{ + xfs_drfsbno_t totblocks =3D 0; + xfs_drfsbno_t atotblocks =3D 0; + xfs_dinode_core_t *dinoc; + int di_mode; + int type; + int retval =3D 0; + __uint64_t nextents; + __uint64_t anextents; + xfs_ino_t lino; + const int is_free =3D 0; + const int is_used =3D 1; + blkmap_t *dblkmap =3D NULL; + + *dirty =3D *isa_dir =3D 0; + *used =3D is_used; + type =3D XR_INO_UNKNOWN; + + dinoc =3D &dino->di_core; + lino =3D XFS_AGINO_TO_INO(mp, agno, ino); + di_mode =3D be16_to_cpu(dinoc->di_mode); + + /* + * if in verify mode, don't modify the inode. + * + * if correcting, reset stuff that has known values + * + * if in uncertain mode, be silent on errors since we're + * trying to find out if these are inodes as opposed + * to assuming that they are. Just return the appropriate + * return code in that case. + * + * If uncertain is set, verify_mode MUST be set. + */ + ASSERT(uncertain =3D=3D 0 || verify_mode !=3D 0); + + if (be16_to_cpu(dinoc->di_magic) !=3D XFS_DINODE_MAGIC) { + retval =3D 1; + if (!uncertain) + do_warn(_("bad magic number 0x%x on inode %llu%c"), + be16_to_cpu(dinoc->di_magic), lino, + verify_mode ? '\n' : ','); + if (!verify_mode) { + if (!no_modify) { + do_warn(_(" resetting magic number\n")); + dinoc->di_magic =3D cpu_to_be16(XFS_DINODE_MAGIC); + *dirty =3D 1; + } else + do_warn(_(" would reset magic number\n")); + } + } + + if (!XFS_DINODE_GOOD_VERSION(dinoc->di_version) || + (!fs_inode_nlink && dinoc->di_version > XFS_DINODE_VERSION_1)) { + retval =3D 1; + if (!uncertain) + do_warn(_("bad version number 0x%x on inode %llu%c"), + dinoc->di_version, lino, + verify_mode ? '\n' : ','); + if (!verify_mode) { + if (!no_modify) { + do_warn(_(" resetting version number\n")); + dinoc->di_version =3D (fs_inode_nlink) ? + XFS_DINODE_VERSION_2 : + XFS_DINODE_VERSION_1; + *dirty =3D 1; + } else + do_warn(_(" would reset version number\n")); + } + } + + /* + * blow out of here if the inode size is < 0 + */ + if ((xfs_fsize_t)be64_to_cpu(dinoc->di_size) < 0) { + if (!uncertain) + do_warn(_("bad (negative) size %lld on inode %llu\n"), + be64_to_cpu(dinoc->di_size), lino); + if (verify_mode) + return 1; + goto clear_bad_out; + } + + /* + * if not in verify mode, check to sii if the inode and imap + * agree that the inode is free + */ + if (!verify_mode && di_mode =3D=3D 0) { + /* + * was_free value is not meaningful if we're in verify mode + */ + if (was_free) { + /* + * easy case, inode free -- inode and map agree, clear + * it just in case to ensure that format, etc. are + * set correctly + */ + if (!no_modify) + *dirty +=3D clear_dinode(mp, dino, lino); + *used =3D is_free; + return 0; + } + /* + * the inode looks free but the map says it's in use. + * clear the inode just to be safe and mark the inode + * free. + */ + do_warn(_("imap claims a free inode %llu is in use, "), lino); + if (!no_modify) { + do_warn(_("correcting imap and clearing inode\n")); + *dirty +=3D clear_dinode(mp, dino, lino); + retval =3D 1; + } else + do_warn(_("would correct imap and clear inode\n")); + *used =3D is_free; + return retval; + } = - if (no_modify && err !=3D 0) { - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - blkmap_free(dblkmap); - blkmap_free(ablkmap); - return(1); - } + /* + * because of the lack of any write ordering guarantee, it's + * possible that the core got updated but the forks didn't. + * so rather than be ambitious (and probably incorrect), + * if there's an inconsistency, we get conservative and + * just pitch the file. blow off checking formats of + * free inodes since technically any format is legal + * as we reset the inode when we re-use it. + */ + if (di_mode !=3D 0 && check_dinode_mode_format(dinoc) !=3D 0) { + if (!uncertain) + do_warn(_("bad inode format in inode %llu\n"), lino); + if (verify_mode) + return 1; + goto clear_bad_out; + } = - ASSERT(err =3D=3D 0); - } + if (verify_mode) + return retval; = - /* - * do attribute semantic-based consistency checks now - */ + /* + * clear the next unlinked field if necessary on a good + * inode only during phase 4 -- when checking for inodes + * referencing duplicate blocks. then it's safe because + * we've done the inode discovery and have found all the inodes + * we're going to find. check_dups is set to 1 only during + * phase 4. Ugly. + */ + if (check_dups && !no_modify) + *dirty +=3D clear_dinode_unlinked(mp, dino); = - /* get this only in phase 3, not in both phase 3 and 4 */ - if (extra_attr_check) { - if ((err =3D process_attributes(mp, lino, dino, ablkmap, - &repair))) { - do_warn( - _("problem with attribute contents in inode %llu\n"), lino); - if(!repair) { - /* clear attributes if not done already */ - if (!no_modify) { - *dirty +=3D clear_dinode_attr( - mp, dino, lino); - dinoc->di_aformat =3D - XFS_DINODE_FMT_LOCAL; - } else { - do_warn( - _("would clear attr fork\n")); - } - atotblocks =3D 0; - anextents =3D 0; - } - else { - *dirty =3D 1; /* it's been repaired */ - } - } - } - blkmap_free(ablkmap); + /* set type and map type info */ = - } else - anextents =3D 0; + switch (di_mode & S_IFMT) { + case S_IFDIR: + type =3D XR_INO_DIR; + *isa_dir =3D 1; + break; + case S_IFREG: + if (be16_to_cpu(dinoc->di_flags) & XFS_DIFLAG_REALTIME) + type =3D XR_INO_RTDATA; + else if (lino =3D=3D mp->m_sb.sb_rbmino) + type =3D XR_INO_RTBITMAP; + else if (lino =3D=3D mp->m_sb.sb_rsumino) + type =3D XR_INO_RTSUM; + else + type =3D XR_INO_DATA; + break; + case S_IFLNK: + type =3D XR_INO_SYMLINK; + break; + case S_IFCHR: + type =3D XR_INO_CHRDEV; + break; + case S_IFBLK: + type =3D XR_INO_BLKDEV; + break; + case S_IFSOCK: + type =3D XR_INO_SOCK; + break; + case S_IFIFO: + type =3D XR_INO_FIFO; + break; + default: + do_warn(_("bad inode type %#o inode %llu\n"), + di_mode & S_IFMT, lino); + goto clear_bad_out; + } = /* - * enforce totblocks is 0 for misc types - */ - if (process_misc_ino_types_blocks(totblocks, lino, type)) { - if (!no_modify) { - *dirty +=3D clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - blkmap_free(dblkmap); - return(1); - } + * type checks for superblock inodes + */ + if (process_check_sb_inodes(mp, dinoc, lino, &type, dirty) !=3D 0) + goto clear_bad_out; = /* - * correct space counters if required + * only regular files with REALTIME or EXTSIZE flags set can have + * extsize set, or directories with EXTSZINHERIT. */ - if (totblocks + atotblocks !=3D INT_GET(dinoc->di_nblocks, ARCH_CONVER= T)) { - if (!no_modify) { - do_warn( - _("correcting nblocks for inode %llu, was %llu - counted %llu\n"), - lino, INT_GET(dinoc->di_nblocks, ARCH_CONVERT), - totblocks + atotblocks); - *dirty =3D 1; - INT_SET(dinoc->di_nblocks, ARCH_CONVERT, totblocks + atotblocks); - } else { - do_warn( - _("bad nblocks %llu for inode %llu, would reset to %llu\n"), - INT_GET(dinoc->di_nblocks, ARCH_CONVERT), lino, - totblocks + atotblocks); + if (dinoc->di_extsize) { + if ((type =3D=3D XR_INO_RTDATA) || + (type =3D=3D XR_INO_DIR && (be16_to_cpu(dinoc->di_flags) & + XFS_DIFLAG_EXTSZINHERIT)) || + (type =3D=3D XR_INO_DATA && (be16_to_cpu(dinoc->di_flags) & + XFS_DIFLAG_EXTSIZE))) { + /* s'okay */ ; + } else { + do_warn(_("bad non-zero extent size %u for " + "non-realtime/extsize inode %llu, "), + be32_to_cpu(dinoc->di_extsize), lino); + if (!no_modify) { + do_warn(_("resetting to zero\n")); + dinoc->di_extsize =3D 0; + *dirty =3D 1; + } else + do_warn(_("would reset to zero\n")); } } = - if (nextents > MAXEXTNUM) { - do_warn(_("too many data fork extents (%llu) in inode %llu\n"), - nextents, lino); + /* + * general size/consistency checks: + */ + if (process_check_inode_sizes(mp, dino, lino, type) !=3D 0) + goto clear_bad_out; = - if (!no_modify) { - *dirty +=3D clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - blkmap_free(dblkmap); + /* + * check for illegal values of forkoff + */ + if (process_check_inode_forkoff(mp, dinoc, lino) !=3D 0) + goto clear_bad_out; = - return(1); - } - if (nextents !=3D INT_GET(dinoc->di_nextents, ARCH_CONVERT)) { - if (!no_modify) { - do_warn( - _("correcting nextents for inode %llu, was %d - counted %llu\n"), - lino, INT_GET(dinoc->di_nextents, ARCH_CONVERT), - nextents); - *dirty =3D 1; - INT_SET(dinoc->di_nextents, ARCH_CONVERT, - (xfs_extnum_t) nextents); - } else { - do_warn( - _("bad nextents %d for inode %llu, would reset to %llu\n"), - INT_GET(dinoc->di_nextents, ARCH_CONVERT), - lino, nextents); - } - } + /* + * check data fork -- if it's bad, clear the inode + */ + if (process_inode_data_fork(mp, agno, ino, dino, type, dirty, + &totblocks, &nextents, &dblkmap, check_dups) !=3D 0) + goto bad_out; = - if (anextents > MAXAEXTNUM) { - do_warn(_("too many attr fork extents (%llu) in inode %llu\n"), - anextents, lino); + /* + * check attribute fork if necessary. attributes are + * always stored in the regular filesystem. + */ + if (process_inode_attr_fork(mp, agno, ino, dino, type, dirty, + &atotblocks, &anextents, check_dups, extra_attr_check, + &retval)) + goto bad_out; = - if (!no_modify) { - *dirty +=3D clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - blkmap_free(dblkmap); - return(1); - } - if (anextents !=3D INT_GET(dinoc->di_anextents, ARCH_CONVERT)) { - if (!no_modify) { - do_warn( - _("correcting anextents for inode %llu, was %d - counted %llu\n"), - lino, - INT_GET(dinoc->di_anextents, ARCH_CONVERT), - anextents); - *dirty =3D 1; - INT_SET(dinoc->di_anextents, ARCH_CONVERT, - (xfs_aextnum_t) anextents); - } else { - do_warn( - _("bad anextents %d for inode %llu, would reset to %llu\n"), - INT_GET(dinoc->di_anextents, ARCH_CONVERT), - lino, anextents); - } - } + /* + * enforce totblocks is 0 for misc types + */ + if (process_misc_ino_types_blocks(totblocks, lino, type)) + goto clear_bad_out; + + /* + * correct space counters if required + */ + if (process_inode_blocks_and_extents(dinoc, totblocks + atotblocks, + nextents, anextents, lino, dirty) !=3D 0) + goto clear_bad_out; = /* * do any semantic type-based checking here */ switch (type) { case XR_INO_DIR: - if (XFS_SB_VERSION_HASDIRV2(&mp->m_sb)) - err =3D process_dir2(mp, lino, dino, ino_discovery, - dirty, "", parent, dblkmap); - else - err =3D process_dir(mp, lino, dino, ino_discovery, - dirty, "", parent, dblkmap); - if (err) - do_warn( - _("problem with directory contents in inode %llu\n"), - lino); - break; - case XR_INO_RTBITMAP: - /* process_rtbitmap XXX */ - err =3D 0; - break; - case XR_INO_RTSUM: - /* process_rtsummary XXX */ - err =3D 0; + if (process_dir2(mp, lino, dino, ino_discovery, dirty, "", + parent, dblkmap) !=3D 0) { + do_warn(_("problem with directory contents in " + "inode %llu\n"), lino); + goto clear_bad_out; + } break; case XR_INO_SYMLINK: - if ((err =3D process_symlink(mp, lino, dino, dblkmap))) + if (process_symlink(mp, lino, dino, dblkmap) !=3D 0) { do_warn(_("problem with symbolic link in inode %llu\n"), lino); - break; - case XR_INO_DATA: /* fall through to FIFO case ... */ - case XR_INO_RTDATA: /* fall through to FIFO case ... */ - case XR_INO_CHRDEV: /* fall through to FIFO case ... */ - case XR_INO_BLKDEV: /* fall through to FIFO case ... */ - case XR_INO_SOCK: /* fall through to FIFO case ... */ - case XR_INO_FIFO: - err =3D 0; + goto clear_bad_out; + } break; default: - printf(_("Unexpected inode type\n")); - abort(); + break; } = if (dblkmap) blkmap_free(dblkmap); = - if (err) { - /* - * problem in the inode type-specific semantic - * checking, clear out the inode and get out - */ - if (!no_modify) { - *dirty +=3D clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - *cleared =3D 1; - *used =3D is_free; - *isa_dir =3D 0; - - return(1); - } - /* * check nlinks feature, if it's a version 1 inode, * just leave nlinks alone. even if it's set wrong, * it'll be reset when read in. */ - if (dinoc->di_version > XFS_DINODE_VERSION_1 && !fs_inode_nlink) { - /* - * do we have a fs/inode version mismatch with a valid - * version 2 inode here that has to stay version 2 or - * lose links? - */ - if (INT_GET(dinoc->di_nlink, ARCH_CONVERT) > XFS_MAXLINK_1) { - /* - * yes. are nlink inodes allowed? - */ - if (fs_inode_nlink_allowed) { - /* - * yes, update status variable which will - * cause sb to be updated later. - */ - fs_inode_nlink =3D 1; - do_warn( - _("version 2 inode %llu claims > %u links, "), - lino, XFS_MAXLINK_1); - if (!no_modify) { - do_warn( - _("updating superblock version number\n")); - } else { - do_warn( - _("would update superblock version number\n")); - } - } else { - /* - * no, have to convert back to onlinks - * even if we lose some links - */ - do_warn( - _("WARNING: version 2 inode %llu claims > %u links, "), - lino, XFS_MAXLINK_1); - if (!no_modify) { - do_warn( - _("converting back to version 1,\n\tthis may destroy %d links\n"), - INT_GET(dinoc->di_nlink, - ARCH_CONVERT) - - XFS_MAXLINK_1); - - dinoc->di_version =3D - XFS_DINODE_VERSION_1; - INT_SET(dinoc->di_nlink, ARCH_CONVERT, - XFS_MAXLINK_1); - INT_SET(dinoc->di_onlink, ARCH_CONVERT, - XFS_MAXLINK_1); - - *dirty =3D 1; - } else { - do_warn( - _("would convert back to version 1,\n\tthis might destroy %d links\n")= , - INT_GET(dinoc->di_nlink, - ARCH_CONVERT) - - XFS_MAXLINK_1); - } - } - } else { - /* - * do we have a v2 inode that we could convert back - * to v1 without losing any links? if we do and - * we have a mismatch between superblock bits and the - * version bit, alter the version bit in this case. - * - * the case where we lost links was handled above. - */ - do_warn(_("found version 2 inode %llu, "), lino); - if (!no_modify) { - do_warn(_("converting back to version 1\n")); - - dinoc->di_version =3D - XFS_DINODE_VERSION_1; - INT_SET(dinoc->di_onlink, ARCH_CONVERT, - INT_GET(dinoc->di_nlink, ARCH_CONVERT)); - - *dirty =3D 1; - } else { - do_warn(_("would convert back to version 1\n")); - } - } - } + *dirty =3D process_check_inode_nlink_version(dinoc, lino); = - /* - * ok, if it's still a version 2 inode, it's going - * to stay a version 2 inode. it should have a zero - * onlink field, so clear it. - */ - if (dinoc->di_version > XFS_DINODE_VERSION_1 && - INT_GET(dinoc->di_onlink, ARCH_CONVERT) > 0 && - fs_inode_nlink > 0) { - if (!no_modify) { - do_warn( -_("clearing obsolete nlink field in version 2 inode %llu, was %d, now 0= \n"), - lino, INT_GET(dinoc->di_onlink, ARCH_CONVERT)); - dinoc->di_onlink =3D 0; - *dirty =3D 1; - } else { - do_warn( -_("would clear obsolete nlink field in version 2 inode %llu, currently = %d\n"), - lino, INT_GET(dinoc->di_onlink, ARCH_CONVERT)); - *dirty =3D 1; - } - } + return retval; = - return(retval > 0 ? 1 : 0); +clear_bad_out: + if (!no_modify) { + *dirty +=3D clear_dinode(mp, dino, lino); + ASSERT(*dirty > 0); + } +bad_out: + *used =3D is_free; + *isa_dir =3D 0; + if (dblkmap) + blkmap_free(dblkmap); + return 1; } = /* @@ -2983,8 +2835,6 @@ * claimed blocks using the bitmap. * Outs: * dirty -- whether we changed the inode (1 =3D=3D yes) - * cleared -- whether we cleared the inode (1 =3D=3D yes). In - * no modify mode, if we would have cleared it * used -- 1 if the inode is used, 0 if free. In no modify * mode, whether the inode should be used or free * isa_dir -- 1 if the inode is a directory, 0 if not. In @@ -2994,30 +2844,29 @@ */ = int -process_dinode(xfs_mount_t *mp, - xfs_dinode_t *dino, - xfs_agnumber_t agno, - xfs_agino_t ino, - int was_free, - int *dirty, - int *cleared, - int *used, - int ino_discovery, - int check_dups, - int extra_attr_check, - int *isa_dir, - xfs_ino_t *parent) +process_dinode( + xfs_mount_t *mp, + xfs_dinode_t *dino, + xfs_agnumber_t agno, + xfs_agino_t ino, + int was_free, + int *dirty, + int *used, + int ino_discovery, + int check_dups, + int extra_attr_check, + int *isa_dir, + xfs_ino_t *parent) { - const int verify_mode =3D 0; - const int uncertain =3D 0; + const int verify_mode =3D 0; + const int uncertain =3D 0; = #ifdef XR_INODE_TRACE fprintf(stderr, "processing inode %d/%d\n", agno, ino); #endif - return(process_dinode_int(mp, dino, agno, ino, was_free, dirty, - cleared, used, verify_mode, uncertain, - ino_discovery, check_dups, extra_attr_check, - isa_dir, parent)); + return process_dinode_int(mp, dino, agno, ino, was_free, dirty, used, + verify_mode, uncertain, ino_discovery, + check_dups, extra_attr_check, isa_dir, parent); } = /* @@ -3027,25 +2876,24 @@ * if the inode passes the cursory sanity check, 1 otherwise. */ int -verify_dinode(xfs_mount_t *mp, - xfs_dinode_t *dino, - xfs_agnumber_t agno, - xfs_agino_t ino) -{ - xfs_ino_t parent; - int cleared =3D 0; - int used =3D 0; - int dirty =3D 0; - int isa_dir =3D 0; - const int verify_mode =3D 1; - const int check_dups =3D 0; - const int ino_discovery =3D 0; - const int uncertain =3D 0; - - return(process_dinode_int(mp, dino, agno, ino, 0, &dirty, - &cleared, &used, verify_mode, - uncertain, ino_discovery, check_dups, - 0, &isa_dir, &parent)); +verify_dinode( + xfs_mount_t *mp, + xfs_dinode_t *dino, + xfs_agnumber_t agno, + xfs_agino_t ino) +{ + xfs_ino_t parent; + int used =3D 0; + int dirty =3D 0; + int isa_dir =3D 0; + const int verify_mode =3D 1; + const int check_dups =3D 0; + const int ino_discovery =3D 0; + const int uncertain =3D 0; + + return process_dinode_int(mp, dino, agno, ino, 0, &dirty, &used, + verify_mode, uncertain, ino_discovery, + check_dups, 0, &isa_dir, &parent); } = /* @@ -3054,23 +2902,22 @@ * returns 0 if the inode passes the cursory sanity check, 1 otherwise.= */ int -verify_uncertain_dinode(xfs_mount_t *mp, - xfs_dinode_t *dino, - xfs_agnumber_t agno, - xfs_agino_t ino) -{ - xfs_ino_t parent; - int cleared =3D 0; - int used =3D 0; - int dirty =3D 0; - int isa_dir =3D 0; - const int verify_mode =3D 1; - const int check_dups =3D 0; - const int ino_discovery =3D 0; - const int uncertain =3D 1; - - return(process_dinode_int(mp, dino, agno, ino, 0, &dirty, - &cleared, &used, verify_mode, - uncertain, ino_discovery, check_dups, - 0, &isa_dir, &parent)); +verify_uncertain_dinode( + xfs_mount_t *mp, + xfs_dinode_t *dino, + xfs_agnumber_t agno, + xfs_agino_t ino) +{ + xfs_ino_t parent; + int used =3D 0; + int dirty =3D 0; + int isa_dir =3D 0; + const int verify_mode =3D 1; + const int check_dups =3D 0; + const int ino_discovery =3D 0; + const int uncertain =3D 1; + + return process_dinode_int(mp, dino, agno, ino, 0, &dirty, &used, + verify_mode, uncertain, ino_discovery, + check_dups, 0, &isa_dir, &parent); } Index: ci/xfsprogs/repair/dinode.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/repair/dinode.h 2007-11-16 14:45:56.000000000 +1100= +++ ci/xfsprogs/repair/dinode.h 2007-11-16 14:46:32.000000000 +1100 @@ -84,7 +84,6 @@ xfs_agino_t ino, int was_free, int *dirty, - int *tossit, int *used, int check_dirs, int check_dups, ------------blQY9A8HShDiztkzvReN2F Content-Disposition: attachment; filename=ci_user.patch Content-Type: text/x-patch; name=ci_user.patch Content-Transfer-Encoding: Quoted-Printable =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D xfsprogs/include/casefoldtable.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D Index: ci/xfsprogs/include/casefoldtable.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ci/xfsprogs/include/casefoldtable.h 2008-01-18 15:00:08.788602304 +1= 100 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2007 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation,= + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef CASEFOLDTABLE_H +#define CASEFOLDTABLE_H + +#include "xfs_unicode.h" + +#define XFS_CFT_MIN_NUM_TABLES 3 /* minumum number of tables */ +#define XFS_CFT_MAX_NUM_TABLES 3 /* maximum number of tables */ + +int libxfs_create_casefoldtable(xfs_mount_t *mp, int isturkic); + +#endif /* CASEFOLDTABLE_H */ Index: ci/xfsprogs/include/xfs_sb.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/include/xfs_sb.h 2008-01-18 14:50:42.000000000 +110= 0 +++ ci/xfsprogs/include/xfs_sb.h 2008-01-18 15:00:08.788602304 +1100 @@ -46,10 +46,12 @@ #define XFS_SB_VERSION_SECTORBIT 0x0800 #define XFS_SB_VERSION_EXTFLGBIT 0x1000 #define XFS_SB_VERSION_DIRV2BIT 0x2000 +#define XFS_SB_VERSION_OLDCIBIT 0x4000 #define XFS_SB_VERSION_MOREBITSBIT 0x8000 #define XFS_SB_VERSION_OKSASHFBITS \ (XFS_SB_VERSION_EXTFLGBIT | \ - XFS_SB_VERSION_DIRV2BIT) + XFS_SB_VERSION_DIRV2BIT | \ + XFS_SB_VERSION_OLDCIBIT) #define XFS_SB_VERSION_OKREALFBITS \ (XFS_SB_VERSION_ATTRBIT | \ XFS_SB_VERSION_NLINKBIT | \ @@ -82,13 +84,12 @@ #define XFS_SB_VERSION2_DONOTUSEBIT2 0x00000004 #define XFS_SB_VERSION2_ATTR2BIT 0x00000008 /* Inline attr rework */ #define XFS_SB_VERSION2_PARENTBIT 0x00000010 /* Parent pointers */ -#define XFS_SB_VERSION2_SASHFBITS 0xff000000 /* Mask: features that - require changing - PROM and SASH */ +#define XFS_SB_VERSION2_UNICODEBIT 0x00000020 /* Unicode names */ = #define XFS_SB_VERSION2_OKREALFBITS \ - (XFS_SB_VERSION2_ATTR2BIT | \ - XFS_SB_VERSION2_LAZYSBCOUNTBIT) + (XFS_SB_VERSION2_LAZYSBCOUNTBIT | \ + XFS_SB_VERSION2_ATTR2BIT | \ + XFS_SB_VERSION2_UNICODEBIT) #define XFS_SB_VERSION2_OKSASHFBITS \ (0) #define XFS_SB_VERSION2_OKREALBITS \ @@ -151,6 +152,8 @@ __uint16_t sb_logsectsize; /* sector size for the log, bytes */ __uint32_t sb_logsunit; /* stripe unit size for the log */ __uint32_t sb_features2; /* additional feature bits */ + __uint32_t sb_bad_features2; /* unusable space */ + xfs_ino_t sb_cftino; /* unicode case folding table inode */ } xfs_sb_t; = /* @@ -169,7 +172,7 @@ XFS_SBS_GQUOTINO, XFS_SBS_QFLAGS, XFS_SBS_FLAGS, XFS_SBS_SHARED_VN, XFS_SBS_INOALIGNMT, XFS_SBS_UNIT, XFS_SBS_WIDTH, XFS_SBS_DIRBLKLOG, XFS_SBS_LOGSECTLOG, XFS_SBS_LOGSECTSIZE, XFS_SBS_LOGSUNIT, - XFS_SBS_FEATURES2, + XFS_SBS_FEATURES2, XFS_SBS_BAD_FEATURES2, XFS_SBS_CFTINO, XFS_SBS_FIELDCOUNT } xfs_sb_field_t; = @@ -194,13 +197,15 @@ #define XFS_SB_IFREE XFS_SB_MVAL(IFREE) #define XFS_SB_FDBLOCKS XFS_SB_MVAL(FDBLOCKS) #define XFS_SB_FEATURES2 XFS_SB_MVAL(FEATURES2) +#define XFS_SB_CFTINO XFS_SB_MVAL(CFTINO) #define XFS_SB_NUM_BITS ((int)XFS_SBS_FIELDCOUNT) #define XFS_SB_ALL_BITS ((1LL << XFS_SB_NUM_BITS) - 1) #define XFS_SB_MOD_BITS \ (XFS_SB_UUID | XFS_SB_ROOTINO | XFS_SB_RBMINO | XFS_SB_RSUMINO | \ XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO | XFS_SB_GQUOTINO | \ XFS_SB_QFLAGS | XFS_SB_SHARED_VN | XFS_SB_UNIT | XFS_SB_WIDTH | \ - XFS_SB_ICOUNT | XFS_SB_IFREE | XFS_SB_FDBLOCKS | XFS_SB_FEATURES2) + XFS_SB_ICOUNT | XFS_SB_IFREE | XFS_SB_FDBLOCKS | XFS_SB_FEATURES2 | \= + XFS_SB_CFTINO) = = /* @@ -415,6 +420,12 @@ ((sbp)->sb_versionnum & XFS_SB_VERSION_SECTORBIT); } = +static inline int xfs_sb_version_hasoldci(xfs_sb_t *sbp) +{ + return (XFS_SB_VERSION_NUM(sbp) =3D=3D XFS_SB_VERSION_4) && \ + ((sbp)->sb_versionnum & XFS_SB_VERSION_OLDCIBIT); +} + #define XFS_SB_VERSION_HASMOREBITS(sbp) xfs_sb_version_hasmorebits(sbp)= static inline int xfs_sb_version_hasmorebits(xfs_sb_t *sbp) { @@ -455,6 +466,12 @@ ((sbp)->sb_features2 | XFS_SB_VERSION2_ATTR2BIT))); } = +static inline int xfs_sb_version_hasunicode(xfs_sb_t *sbp) +{ + return (xfs_sb_version_hasmorebits(sbp) && \ + ((sbp)->sb_features2 & XFS_SB_VERSION2_UNICODEBIT)); +} + /* * end of superblock version macros */ Index: ci/xfsprogs/libxfs/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/libxfs/Makefile 2008-01-18 14:50:42.000000000 +1100= +++ ci/xfsprogs/libxfs/Makefile 2008-01-18 15:00:08.816598712 +1100 @@ -11,13 +11,13 @@ LT_AGE =3D 0 = HFILES =3D xfs.h init.h -CFILES =3D bit.c cache.c init.c logitem.c rdwr.c trans.c util.c \ - xfs_alloc.c xfs_ialloc.c xfs_rtalloc.c \ +CFILES =3D bit.c cache.c casefoldtable.c init.c logitem.c rdwr.c trans.= c util.c \ + utf8.c xfs_alloc.c xfs_ialloc.c xfs_rtalloc.c \ xfs_inode.c xfs_btree.c xfs_alloc_btree.c xfs_ialloc_btree.c \ xfs_bmap_btree.c xfs_da_btree.c xfs_dir.c xfs_dir_leaf.c \ xfs_dir2.c xfs_dir2_leaf.c xfs_attr_leaf.c xfs_dir2_block.c \ xfs_dir2_node.c xfs_dir2_data.c xfs_dir2_sf.c xfs_bmap.c \ - xfs_mount.c xfs_trans.c xfs_attr.c + xfs_mount.c xfs_trans.c xfs_attr.c xfs_unicode.c = CFILES +=3D $(PKG_PLATFORM).c PCFILES =3D darwin.c freebsd.c irix.c linux.c Index: ci/xfsprogs/libxfs/casefoldtable.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ci/xfsprogs/libxfs/casefoldtable.c 2008-01-18 15:00:08.832596659 +11= 00 @@ -0,0 +1,760 @@ +/* + * Unicode case folding table automatically generated from + * http://www.unicode.org/Public/UNIDATA/CaseFolding.txt + * + * Characters that map to 0xe000 to 0xe3fff are indexes to the double + * character sequence in xfs_case_fold_double_table. 0xe400 to 0xe7ff + * map to the triple sequences in xfs_case_fold_triple_table. + */ + +#include +#include + +__uint16_t xfs_case_fold_table[15 * 256] =3D { + + /* Most-significant-byte index table */ + + 0x0100, 0x0200, 0x0300, 0x0400, 0x0500, 0x0600, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0700, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0800, 0x0900, + 0x0000, 0x0a00, 0x0000, 0x0000, 0x0b00, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0c00, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0d00, 0x0000, 0x0000, 0x0000, 0x0e00, + + /* Characters U+0000 to U+00FF */ + + 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, + 0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f, + 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, + 0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f, + 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, + 0x0028, 0x0029, 0x002a, 0x002b, 0x002c, 0x002d, 0x002e, 0x002f, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f, + 0x0040, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007a, 0x005b, 0x005c, 0x005d, 0x005e, 0x005f, + 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007a, 0x007b, 0x007c, 0x007d, 0x007e, 0x007f, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, + 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, + 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, + 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x03bc, 0x00b6, 0x00b7, + 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, + 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, + 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, + 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00d7, + 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0xe000, + 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, + 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, + 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, + 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff, + + /* Characters U+0100 to U+01FF */ + + 0x0101, 0x0101, 0x0103, 0x0103, 0x0105, 0x0105, 0x0107, 0x0107, + 0x0109, 0x0109, 0x010b, 0x010b, 0x010d, 0x010d, 0x010f, 0x010f, + 0x0111, 0x0111, 0x0113, 0x0113, 0x0115, 0x0115, 0x0117, 0x0117, + 0x0119, 0x0119, 0x011b, 0x011b, 0x011d, 0x011d, 0x011f, 0x011f, + 0x0121, 0x0121, 0x0123, 0x0123, 0x0125, 0x0125, 0x0127, 0x0127, + 0x0129, 0x0129, 0x012b, 0x012b, 0x012d, 0x012d, 0x012f, 0x012f, + 0xe001, 0x0131, 0x0133, 0x0133, 0x0135, 0x0135, 0x0137, 0x0137, + 0x0138, 0x013a, 0x013a, 0x013c, 0x013c, 0x013e, 0x013e, 0x0140, + 0x0140, 0x0142, 0x0142, 0x0144, 0x0144, 0x0146, 0x0146, 0x0148, + 0x0148, 0xe002, 0x014b, 0x014b, 0x014d, 0x014d, 0x014f, 0x014f, + 0x0151, 0x0151, 0x0153, 0x0153, 0x0155, 0x0155, 0x0157, 0x0157, + 0x0159, 0x0159, 0x015b, 0x015b, 0x015d, 0x015d, 0x015f, 0x015f, + 0x0161, 0x0161, 0x0163, 0x0163, 0x0165, 0x0165, 0x0167, 0x0167, + 0x0169, 0x0169, 0x016b, 0x016b, 0x016d, 0x016d, 0x016f, 0x016f, + 0x0171, 0x0171, 0x0173, 0x0173, 0x0175, 0x0175, 0x0177, 0x0177, + 0x00ff, 0x017a, 0x017a, 0x017c, 0x017c, 0x017e, 0x017e, 0x0073, + 0x0180, 0x0253, 0x0183, 0x0183, 0x0185, 0x0185, 0x0254, 0x0188, + 0x0188, 0x0256, 0x0257, 0x018c, 0x018c, 0x018d, 0x01dd, 0x0259, + 0x025b, 0x0192, 0x0192, 0x0260, 0x0263, 0x0195, 0x0269, 0x0268, + 0x0199, 0x0199, 0x019a, 0x019b, 0x026f, 0x0272, 0x019e, 0x0275, + 0x01a1, 0x01a1, 0x01a3, 0x01a3, 0x01a5, 0x01a5, 0x0280, 0x01a8, + 0x01a8, 0x0283, 0x01aa, 0x01ab, 0x01ad, 0x01ad, 0x0288, 0x01b0, + 0x01b0, 0x028a, 0x028b, 0x01b4, 0x01b4, 0x01b6, 0x01b6, 0x0292, + 0x01b9, 0x01b9, 0x01ba, 0x01bb, 0x01bd, 0x01bd, 0x01be, 0x01bf, + 0x01c0, 0x01c1, 0x01c2, 0x01c3, 0x01c6, 0x01c6, 0x01c6, 0x01c9, + 0x01c9, 0x01c9, 0x01cc, 0x01cc, 0x01cc, 0x01ce, 0x01ce, 0x01d0, + 0x01d0, 0x01d2, 0x01d2, 0x01d4, 0x01d4, 0x01d6, 0x01d6, 0x01d8, + 0x01d8, 0x01da, 0x01da, 0x01dc, 0x01dc, 0x01dd, 0x01df, 0x01df, + 0x01e1, 0x01e1, 0x01e3, 0x01e3, 0x01e5, 0x01e5, 0x01e7, 0x01e7, + 0x01e9, 0x01e9, 0x01eb, 0x01eb, 0x01ed, 0x01ed, 0x01ef, 0x01ef, + 0xe003, 0x01f3, 0x01f3, 0x01f3, 0x01f5, 0x01f5, 0x0195, 0x01bf, + 0x01f9, 0x01f9, 0x01fb, 0x01fb, 0x01fd, 0x01fd, 0x01ff, 0x01ff, + + /* Characters U+0200 to U+02FF */ + + 0x0201, 0x0201, 0x0203, 0x0203, 0x0205, 0x0205, 0x0207, 0x0207, + 0x0209, 0x0209, 0x020b, 0x020b, 0x020d, 0x020d, 0x020f, 0x020f, + 0x0211, 0x0211, 0x0213, 0x0213, 0x0215, 0x0215, 0x0217, 0x0217, + 0x0219, 0x0219, 0x021b, 0x021b, 0x021d, 0x021d, 0x021f, 0x021f, + 0x019e, 0x0221, 0x0223, 0x0223, 0x0225, 0x0225, 0x0227, 0x0227, + 0x0229, 0x0229, 0x022b, 0x022b, 0x022d, 0x022d, 0x022f, 0x022f, + 0x0231, 0x0231, 0x0233, 0x0233, 0x0234, 0x0235, 0x0236, 0x0237, + 0x0238, 0x0239, 0x2c65, 0x023c, 0x023c, 0x019a, 0x2c66, 0x023f, + 0x0240, 0x0242, 0x0242, 0x0180, 0x0289, 0x028c, 0x0247, 0x0247, + 0x0249, 0x0249, 0x024b, 0x024b, 0x024d, 0x024d, 0x024f, 0x024f, + 0x0250, 0x0251, 0x0252, 0x0253, 0x0254, 0x0255, 0x0256, 0x0257, + 0x0258, 0x0259, 0x025a, 0x025b, 0x025c, 0x025d, 0x025e, 0x025f, + 0x0260, 0x0261, 0x0262, 0x0263, 0x0264, 0x0265, 0x0266, 0x0267, + 0x0268, 0x0269, 0x026a, 0x026b, 0x026c, 0x026d, 0x026e, 0x026f, + 0x0270, 0x0271, 0x0272, 0x0273, 0x0274, 0x0275, 0x0276, 0x0277, + 0x0278, 0x0279, 0x027a, 0x027b, 0x027c, 0x027d, 0x027e, 0x027f, + 0x0280, 0x0281, 0x0282, 0x0283, 0x0284, 0x0285, 0x0286, 0x0287, + 0x0288, 0x0289, 0x028a, 0x028b, 0x028c, 0x028d, 0x028e, 0x028f, + 0x0290, 0x0291, 0x0292, 0x0293, 0x0294, 0x0295, 0x0296, 0x0297, + 0x0298, 0x0299, 0x029a, 0x029b, 0x029c, 0x029d, 0x029e, 0x029f, + 0x02a0, 0x02a1, 0x02a2, 0x02a3, 0x02a4, 0x02a5, 0x02a6, 0x02a7, + 0x02a8, 0x02a9, 0x02aa, 0x02ab, 0x02ac, 0x02ad, 0x02ae, 0x02af, + 0x02b0, 0x02b1, 0x02b2, 0x02b3, 0x02b4, 0x02b5, 0x02b6, 0x02b7, + 0x02b8, 0x02b9, 0x02ba, 0x02bb, 0x02bc, 0x02bd, 0x02be, 0x02bf, + 0x02c0, 0x02c1, 0x02c2, 0x02c3, 0x02c4, 0x02c5, 0x02c6, 0x02c7, + 0x02c8, 0x02c9, 0x02ca, 0x02cb, 0x02cc, 0x02cd, 0x02ce, 0x02cf, + 0x02d0, 0x02d1, 0x02d2, 0x02d3, 0x02d4, 0x02d5, 0x02d6, 0x02d7, + 0x02d8, 0x02d9, 0x02da, 0x02db, 0x02dc, 0x02dd, 0x02de, 0x02df, + 0x02e0, 0x02e1, 0x02e2, 0x02e3, 0x02e4, 0x02e5, 0x02e6, 0x02e7, + 0x02e8, 0x02e9, 0x02ea, 0x02eb, 0x02ec, 0x02ed, 0x02ee, 0x02ef, + 0x02f0, 0x02f1, 0x02f2, 0x02f3, 0x02f4, 0x02f5, 0x02f6, 0x02f7, + 0x02f8, 0x02f9, 0x02fa, 0x02fb, 0x02fc, 0x02fd, 0x02fe, 0x02ff, + + /* Characters U+0300 to U+03FF */ + + 0x0300, 0x0301, 0x0302, 0x0303, 0x0304, 0x0305, 0x0306, 0x0307, + 0x0308, 0x0309, 0x030a, 0x030b, 0x030c, 0x030d, 0x030e, 0x030f, + 0x0310, 0x0311, 0x0312, 0x0313, 0x0314, 0x0315, 0x0316, 0x0317, + 0x0318, 0x0319, 0x031a, 0x031b, 0x031c, 0x031d, 0x031e, 0x031f, + 0x0320, 0x0321, 0x0322, 0x0323, 0x0324, 0x0325, 0x0326, 0x0327, + 0x0328, 0x0329, 0x032a, 0x032b, 0x032c, 0x032d, 0x032e, 0x032f, + 0x0330, 0x0331, 0x0332, 0x0333, 0x0334, 0x0335, 0x0336, 0x0337, + 0x0338, 0x0339, 0x033a, 0x033b, 0x033c, 0x033d, 0x033e, 0x033f, + 0x0340, 0x0341, 0x0342, 0x0343, 0x0344, 0x03b9, 0x0346, 0x0347, + 0x0348, 0x0349, 0x034a, 0x034b, 0x034c, 0x034d, 0x034e, 0x034f, + 0x0350, 0x0351, 0x0352, 0x0353, 0x0354, 0x0355, 0x0356, 0x0357, + 0x0358, 0x0359, 0x035a, 0x035b, 0x035c, 0x035d, 0x035e, 0x035f, + 0x0360, 0x0361, 0x0362, 0x0363, 0x0364, 0x0365, 0x0366, 0x0367, + 0x0368, 0x0369, 0x036a, 0x036b, 0x036c, 0x036d, 0x036e, 0x036f, + 0x0370, 0x0371, 0x0372, 0x0373, 0x0374, 0x0375, 0x0376, 0x0377, + 0x0378, 0x0379, 0x037a, 0x037b, 0x037c, 0x037d, 0x037e, 0x037f, + 0x0380, 0x0381, 0x0382, 0x0383, 0x0384, 0x0385, 0x03ac, 0x0387, + 0x03ad, 0x03ae, 0x03af, 0x038b, 0x03cc, 0x038d, 0x03cd, 0x03ce, + 0xe400, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, + 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, + 0x03c0, 0x03c1, 0x03a2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, + 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03ac, 0x03ad, 0x03ae, 0x03af, + 0xe401, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, + 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, + 0x03c0, 0x03c1, 0x03c3, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, + 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0x03cf, + 0x03b2, 0x03b8, 0x03d2, 0x03d3, 0x03d4, 0x03c6, 0x03c0, 0x03d7, + 0x03d9, 0x03d9, 0x03db, 0x03db, 0x03dd, 0x03dd, 0x03df, 0x03df, + 0x03e1, 0x03e1, 0x03e3, 0x03e3, 0x03e5, 0x03e5, 0x03e7, 0x03e7, + 0x03e9, 0x03e9, 0x03eb, 0x03eb, 0x03ed, 0x03ed, 0x03ef, 0x03ef, + 0x03ba, 0x03c1, 0x03f2, 0x03f3, 0x03b8, 0x03b5, 0x03f6, 0x03f8, + 0x03f8, 0x03f2, 0x03fb, 0x03fb, 0x03fc, 0x037b, 0x037c, 0x037d, + + /* Characters U+0400 to U+04FF */ + + 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, + 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x045d, 0x045e, 0x045f, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, + 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, + 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, + 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, + 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x045d, 0x045e, 0x045f, + 0x0461, 0x0461, 0x0463, 0x0463, 0x0465, 0x0465, 0x0467, 0x0467, + 0x0469, 0x0469, 0x046b, 0x046b, 0x046d, 0x046d, 0x046f, 0x046f, + 0x0471, 0x0471, 0x0473, 0x0473, 0x0475, 0x0475, 0x0477, 0x0477, + 0x0479, 0x0479, 0x047b, 0x047b, 0x047d, 0x047d, 0x047f, 0x047f, + 0x0481, 0x0481, 0x0482, 0x0483, 0x0484, 0x0485, 0x0486, 0x0487, + 0x0488, 0x0489, 0x048b, 0x048b, 0x048d, 0x048d, 0x048f, 0x048f, + 0x0491, 0x0491, 0x0493, 0x0493, 0x0495, 0x0495, 0x0497, 0x0497, + 0x0499, 0x0499, 0x049b, 0x049b, 0x049d, 0x049d, 0x049f, 0x049f, + 0x04a1, 0x04a1, 0x04a3, 0x04a3, 0x04a5, 0x04a5, 0x04a7, 0x04a7, + 0x04a9, 0x04a9, 0x04ab, 0x04ab, 0x04ad, 0x04ad, 0x04af, 0x04af, + 0x04b1, 0x04b1, 0x04b3, 0x04b3, 0x04b5, 0x04b5, 0x04b7, 0x04b7, + 0x04b9, 0x04b9, 0x04bb, 0x04bb, 0x04bd, 0x04bd, 0x04bf, 0x04bf, + 0x04cf, 0x04c2, 0x04c2, 0x04c4, 0x04c4, 0x04c6, 0x04c6, 0x04c8, + 0x04c8, 0x04ca, 0x04ca, 0x04cc, 0x04cc, 0x04ce, 0x04ce, 0x04cf, + 0x04d1, 0x04d1, 0x04d3, 0x04d3, 0x04d5, 0x04d5, 0x04d7, 0x04d7, + 0x04d9, 0x04d9, 0x04db, 0x04db, 0x04dd, 0x04dd, 0x04df, 0x04df, + 0x04e1, 0x04e1, 0x04e3, 0x04e3, 0x04e5, 0x04e5, 0x04e7, 0x04e7, + 0x04e9, 0x04e9, 0x04eb, 0x04eb, 0x04ed, 0x04ed, 0x04ef, 0x04ef, + 0x04f1, 0x04f1, 0x04f3, 0x04f3, 0x04f5, 0x04f5, 0x04f7, 0x04f7, + 0x04f9, 0x04f9, 0x04fb, 0x04fb, 0x04fd, 0x04fd, 0x04ff, 0x04ff, + + /* Characters U+0500 to U+05FF */ + + 0x0501, 0x0501, 0x0503, 0x0503, 0x0505, 0x0505, 0x0507, 0x0507, + 0x0509, 0x0509, 0x050b, 0x050b, 0x050d, 0x050d, 0x050f, 0x050f, + 0x0511, 0x0511, 0x0513, 0x0513, 0x0514, 0x0515, 0x0516, 0x0517, + 0x0518, 0x0519, 0x051a, 0x051b, 0x051c, 0x051d, 0x051e, 0x051f, + 0x0520, 0x0521, 0x0522, 0x0523, 0x0524, 0x0525, 0x0526, 0x0527, + 0x0528, 0x0529, 0x052a, 0x052b, 0x052c, 0x052d, 0x052e, 0x052f, + 0x0530, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567, + 0x0568, 0x0569, 0x056a, 0x056b, 0x056c, 0x056d, 0x056e, 0x056f, + 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, + 0x0578, 0x0579, 0x057a, 0x057b, 0x057c, 0x057d, 0x057e, 0x057f, + 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0557, + 0x0558, 0x0559, 0x055a, 0x055b, 0x055c, 0x055d, 0x055e, 0x055f, + 0x0560, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567, + 0x0568, 0x0569, 0x056a, 0x056b, 0x056c, 0x056d, 0x056e, 0x056f, + 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, + 0x0578, 0x0579, 0x057a, 0x057b, 0x057c, 0x057d, 0x057e, 0x057f, + 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0xe004, + 0x0588, 0x0589, 0x058a, 0x058b, 0x058c, 0x058d, 0x058e, 0x058f, + 0x0590, 0x0591, 0x0592, 0x0593, 0x0594, 0x0595, 0x0596, 0x0597, + 0x0598, 0x0599, 0x059a, 0x059b, 0x059c, 0x059d, 0x059e, 0x059f, + 0x05a0, 0x05a1, 0x05a2, 0x05a3, 0x05a4, 0x05a5, 0x05a6, 0x05a7, + 0x05a8, 0x05a9, 0x05aa, 0x05ab, 0x05ac, 0x05ad, 0x05ae, 0x05af, + 0x05b0, 0x05b1, 0x05b2, 0x05b3, 0x05b4, 0x05b5, 0x05b6, 0x05b7, + 0x05b8, 0x05b9, 0x05ba, 0x05bb, 0x05bc, 0x05bd, 0x05be, 0x05bf, + 0x05c0, 0x05c1, 0x05c2, 0x05c3, 0x05c4, 0x05c5, 0x05c6, 0x05c7, + 0x05c8, 0x05c9, 0x05ca, 0x05cb, 0x05cc, 0x05cd, 0x05ce, 0x05cf, + 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7, + 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df, + 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7, + 0x05e8, 0x05e9, 0x05ea, 0x05eb, 0x05ec, 0x05ed, 0x05ee, 0x05ef, + 0x05f0, 0x05f1, 0x05f2, 0x05f3, 0x05f4, 0x05f5, 0x05f6, 0x05f7, + 0x05f8, 0x05f9, 0x05fa, 0x05fb, 0x05fc, 0x05fd, 0x05fe, 0x05ff, + + /* Characters U+1000 to U+10FF */ + + 0x1000, 0x1001, 0x1002, 0x1003, 0x1004, 0x1005, 0x1006, 0x1007, + 0x1008, 0x1009, 0x100a, 0x100b, 0x100c, 0x100d, 0x100e, 0x100f, + 0x1010, 0x1011, 0x1012, 0x1013, 0x1014, 0x1015, 0x1016, 0x1017, + 0x1018, 0x1019, 0x101a, 0x101b, 0x101c, 0x101d, 0x101e, 0x101f, + 0x1020, 0x1021, 0x1022, 0x1023, 0x1024, 0x1025, 0x1026, 0x1027, + 0x1028, 0x1029, 0x102a, 0x102b, 0x102c, 0x102d, 0x102e, 0x102f, + 0x1030, 0x1031, 0x1032, 0x1033, 0x1034, 0x1035, 0x1036, 0x1037, + 0x1038, 0x1039, 0x103a, 0x103b, 0x103c, 0x103d, 0x103e, 0x103f, + 0x1040, 0x1041, 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047, + 0x1048, 0x1049, 0x104a, 0x104b, 0x104c, 0x104d, 0x104e, 0x104f, + 0x1050, 0x1051, 0x1052, 0x1053, 0x1054, 0x1055, 0x1056, 0x1057, + 0x1058, 0x1059, 0x105a, 0x105b, 0x105c, 0x105d, 0x105e, 0x105f, + 0x1060, 0x1061, 0x1062, 0x1063, 0x1064, 0x1065, 0x1066, 0x1067, + 0x1068, 0x1069, 0x106a, 0x106b, 0x106c, 0x106d, 0x106e, 0x106f, + 0x1070, 0x1071, 0x1072, 0x1073, 0x1074, 0x1075, 0x1076, 0x1077, + 0x1078, 0x1079, 0x107a, 0x107b, 0x107c, 0x107d, 0x107e, 0x107f, + 0x1080, 0x1081, 0x1082, 0x1083, 0x1084, 0x1085, 0x1086, 0x1087, + 0x1088, 0x1089, 0x108a, 0x108b, 0x108c, 0x108d, 0x108e, 0x108f, + 0x1090, 0x1091, 0x1092, 0x1093, 0x1094, 0x1095, 0x1096, 0x1097, + 0x1098, 0x1099, 0x109a, 0x109b, 0x109c, 0x109d, 0x109e, 0x109f, + 0x2d00, 0x2d01, 0x2d02, 0x2d03, 0x2d04, 0x2d05, 0x2d06, 0x2d07, + 0x2d08, 0x2d09, 0x2d0a, 0x2d0b, 0x2d0c, 0x2d0d, 0x2d0e, 0x2d0f, + 0x2d10, 0x2d11, 0x2d12, 0x2d13, 0x2d14, 0x2d15, 0x2d16, 0x2d17, + 0x2d18, 0x2d19, 0x2d1a, 0x2d1b, 0x2d1c, 0x2d1d, 0x2d1e, 0x2d1f, + 0x2d20, 0x2d21, 0x2d22, 0x2d23, 0x2d24, 0x2d25, 0x10c6, 0x10c7, + 0x10c8, 0x10c9, 0x10ca, 0x10cb, 0x10cc, 0x10cd, 0x10ce, 0x10cf, + 0x10d0, 0x10d1, 0x10d2, 0x10d3, 0x10d4, 0x10d5, 0x10d6, 0x10d7, + 0x10d8, 0x10d9, 0x10da, 0x10db, 0x10dc, 0x10dd, 0x10de, 0x10df, + 0x10e0, 0x10e1, 0x10e2, 0x10e3, 0x10e4, 0x10e5, 0x10e6, 0x10e7, + 0x10e8, 0x10e9, 0x10ea, 0x10eb, 0x10ec, 0x10ed, 0x10ee, 0x10ef, + 0x10f0, 0x10f1, 0x10f2, 0x10f3, 0x10f4, 0x10f5, 0x10f6, 0x10f7, + 0x10f8, 0x10f9, 0x10fa, 0x10fb, 0x10fc, 0x10fd, 0x10fe, 0x10ff, + + /* Characters U+1E00 to U+1EFF */ + + 0x1e01, 0x1e01, 0x1e03, 0x1e03, 0x1e05, 0x1e05, 0x1e07, 0x1e07, + 0x1e09, 0x1e09, 0x1e0b, 0x1e0b, 0x1e0d, 0x1e0d, 0x1e0f, 0x1e0f, + 0x1e11, 0x1e11, 0x1e13, 0x1e13, 0x1e15, 0x1e15, 0x1e17, 0x1e17, + 0x1e19, 0x1e19, 0x1e1b, 0x1e1b, 0x1e1d, 0x1e1d, 0x1e1f, 0x1e1f, + 0x1e21, 0x1e21, 0x1e23, 0x1e23, 0x1e25, 0x1e25, 0x1e27, 0x1e27, + 0x1e29, 0x1e29, 0x1e2b, 0x1e2b, 0x1e2d, 0x1e2d, 0x1e2f, 0x1e2f, + 0x1e31, 0x1e31, 0x1e33, 0x1e33, 0x1e35, 0x1e35, 0x1e37, 0x1e37, + 0x1e39, 0x1e39, 0x1e3b, 0x1e3b, 0x1e3d, 0x1e3d, 0x1e3f, 0x1e3f, + 0x1e41, 0x1e41, 0x1e43, 0x1e43, 0x1e45, 0x1e45, 0x1e47, 0x1e47, + 0x1e49, 0x1e49, 0x1e4b, 0x1e4b, 0x1e4d, 0x1e4d, 0x1e4f, 0x1e4f, + 0x1e51, 0x1e51, 0x1e53, 0x1e53, 0x1e55, 0x1e55, 0x1e57, 0x1e57, + 0x1e59, 0x1e59, 0x1e5b, 0x1e5b, 0x1e5d, 0x1e5d, 0x1e5f, 0x1e5f, + 0x1e61, 0x1e61, 0x1e63, 0x1e63, 0x1e65, 0x1e65, 0x1e67, 0x1e67, + 0x1e69, 0x1e69, 0x1e6b, 0x1e6b, 0x1e6d, 0x1e6d, 0x1e6f, 0x1e6f, + 0x1e71, 0x1e71, 0x1e73, 0x1e73, 0x1e75, 0x1e75, 0x1e77, 0x1e77, + 0x1e79, 0x1e79, 0x1e7b, 0x1e7b, 0x1e7d, 0x1e7d, 0x1e7f, 0x1e7f, + 0x1e81, 0x1e81, 0x1e83, 0x1e83, 0x1e85, 0x1e85, 0x1e87, 0x1e87, + 0x1e89, 0x1e89, 0x1e8b, 0x1e8b, 0x1e8d, 0x1e8d, 0x1e8f, 0x1e8f, + 0x1e91, 0x1e91, 0x1e93, 0x1e93, 0x1e95, 0x1e95, 0xe005, 0xe006, + 0xe007, 0xe008, 0xe009, 0x1e61, 0x1e9c, 0x1e9d, 0x1e9e, 0x1e9f, + 0x1ea1, 0x1ea1, 0x1ea3, 0x1ea3, 0x1ea5, 0x1ea5, 0x1ea7, 0x1ea7, + 0x1ea9, 0x1ea9, 0x1eab, 0x1eab, 0x1ead, 0x1ead, 0x1eaf, 0x1eaf, + 0x1eb1, 0x1eb1, 0x1eb3, 0x1eb3, 0x1eb5, 0x1eb5, 0x1eb7, 0x1eb7, + 0x1eb9, 0x1eb9, 0x1ebb, 0x1ebb, 0x1ebd, 0x1ebd, 0x1ebf, 0x1ebf, + 0x1ec1, 0x1ec1, 0x1ec3, 0x1ec3, 0x1ec5, 0x1ec5, 0x1ec7, 0x1ec7, + 0x1ec9, 0x1ec9, 0x1ecb, 0x1ecb, 0x1ecd, 0x1ecd, 0x1ecf, 0x1ecf, + 0x1ed1, 0x1ed1, 0x1ed3, 0x1ed3, 0x1ed5, 0x1ed5, 0x1ed7, 0x1ed7, + 0x1ed9, 0x1ed9, 0x1edb, 0x1edb, 0x1edd, 0x1edd, 0x1edf, 0x1edf, + 0x1ee1, 0x1ee1, 0x1ee3, 0x1ee3, 0x1ee5, 0x1ee5, 0x1ee7, 0x1ee7, + 0x1ee9, 0x1ee9, 0x1eeb, 0x1eeb, 0x1eed, 0x1eed, 0x1eef, 0x1eef, + 0x1ef1, 0x1ef1, 0x1ef3, 0x1ef3, 0x1ef5, 0x1ef5, 0x1ef7, 0x1ef7, + 0x1ef9, 0x1ef9, 0x1efa, 0x1efb, 0x1efc, 0x1efd, 0x1efe, 0x1eff, + + /* Characters U+1F00 to U+1FFF */ + + 0x1f00, 0x1f01, 0x1f02, 0x1f03, 0x1f04, 0x1f05, 0x1f06, 0x1f07, + 0x1f00, 0x1f01, 0x1f02, 0x1f03, 0x1f04, 0x1f05, 0x1f06, 0x1f07, + 0x1f10, 0x1f11, 0x1f12, 0x1f13, 0x1f14, 0x1f15, 0x1f16, 0x1f17, + 0x1f10, 0x1f11, 0x1f12, 0x1f13, 0x1f14, 0x1f15, 0x1f1e, 0x1f1f, + 0x1f20, 0x1f21, 0x1f22, 0x1f23, 0x1f24, 0x1f25, 0x1f26, 0x1f27, + 0x1f20, 0x1f21, 0x1f22, 0x1f23, 0x1f24, 0x1f25, 0x1f26, 0x1f27, + 0x1f30, 0x1f31, 0x1f32, 0x1f33, 0x1f34, 0x1f35, 0x1f36, 0x1f37, + 0x1f30, 0x1f31, 0x1f32, 0x1f33, 0x1f34, 0x1f35, 0x1f36, 0x1f37, + 0x1f40, 0x1f41, 0x1f42, 0x1f43, 0x1f44, 0x1f45, 0x1f46, 0x1f47, + 0x1f40, 0x1f41, 0x1f42, 0x1f43, 0x1f44, 0x1f45, 0x1f4e, 0x1f4f, + 0xe00a, 0x1f51, 0xe402, 0x1f53, 0xe403, 0x1f55, 0xe404, 0x1f57, + 0x1f58, 0x1f51, 0x1f5a, 0x1f53, 0x1f5c, 0x1f55, 0x1f5e, 0x1f57, + 0x1f60, 0x1f61, 0x1f62, 0x1f63, 0x1f64, 0x1f65, 0x1f66, 0x1f67, + 0x1f60, 0x1f61, 0x1f62, 0x1f63, 0x1f64, 0x1f65, 0x1f66, 0x1f67, + 0x1f70, 0x1f71, 0x1f72, 0x1f73, 0x1f74, 0x1f75, 0x1f76, 0x1f77, + 0x1f78, 0x1f79, 0x1f7a, 0x1f7b, 0x1f7c, 0x1f7d, 0x1f7e, 0x1f7f, + 0xe00b, 0xe00c, 0xe00d, 0xe00e, 0xe00f, 0xe010, 0xe011, 0xe012, + 0xe013, 0xe014, 0xe015, 0xe016, 0xe017, 0xe018, 0xe019, 0xe01a, + 0xe01b, 0xe01c, 0xe01d, 0xe01e, 0xe01f, 0xe020, 0xe021, 0xe022, + 0xe023, 0xe024, 0xe025, 0xe026, 0xe027, 0xe028, 0xe029, 0xe02a, + 0xe02b, 0xe02c, 0xe02d, 0xe02e, 0xe02f, 0xe030, 0xe031, 0xe032, + 0xe033, 0xe034, 0xe035, 0xe036, 0xe037, 0xe038, 0xe039, 0xe03a, + 0x1fb0, 0x1fb1, 0xe03b, 0xe03c, 0xe03d, 0x1fb5, 0xe03e, 0xe405, + 0x1fb0, 0x1fb1, 0x1f70, 0x1f71, 0xe03f, 0x1fbd, 0x03b9, 0x1fbf, + 0x1fc0, 0x1fc1, 0xe040, 0xe041, 0xe042, 0x1fc5, 0xe043, 0xe406, + 0x1f72, 0x1f73, 0x1f74, 0x1f75, 0xe044, 0x1fcd, 0x1fce, 0x1fcf, + 0x1fd0, 0x1fd1, 0xe407, 0xe408, 0x1fd4, 0x1fd5, 0xe045, 0xe409, + 0x1fd0, 0x1fd1, 0x1f76, 0x1f77, 0x1fdc, 0x1fdd, 0x1fde, 0x1fdf, + 0x1fe0, 0x1fe1, 0xe40a, 0xe40b, 0xe046, 0x1fe5, 0xe047, 0xe40c, + 0x1fe0, 0x1fe1, 0x1f7a, 0x1f7b, 0x1fe5, 0x1fed, 0x1fee, 0x1fef, + 0x1ff0, 0x1ff1, 0xe048, 0xe049, 0xe04a, 0x1ff5, 0xe04b, 0xe40d, + 0x1f78, 0x1f79, 0x1f7c, 0x1f7d, 0xe04c, 0x1ffd, 0x1ffe, 0x1fff, + + /* Characters U+2100 to U+21FF */ + + 0x2100, 0x2101, 0x2102, 0x2103, 0x2104, 0x2105, 0x2106, 0x2107, + 0x2108, 0x2109, 0x210a, 0x210b, 0x210c, 0x210d, 0x210e, 0x210f, + 0x2110, 0x2111, 0x2112, 0x2113, 0x2114, 0x2115, 0x2116, 0x2117, + 0x2118, 0x2119, 0x211a, 0x211b, 0x211c, 0x211d, 0x211e, 0x211f, + 0x2120, 0x2121, 0x2122, 0x2123, 0x2124, 0x2125, 0x03c9, 0x2127, + 0x2128, 0x2129, 0x006b, 0x00e5, 0x212c, 0x212d, 0x212e, 0x212f, + 0x2130, 0x2131, 0x214e, 0x2133, 0x2134, 0x2135, 0x2136, 0x2137, + 0x2138, 0x2139, 0x213a, 0x213b, 0x213c, 0x213d, 0x213e, 0x213f, + 0x2140, 0x2141, 0x2142, 0x2143, 0x2144, 0x2145, 0x2146, 0x2147, + 0x2148, 0x2149, 0x214a, 0x214b, 0x214c, 0x214d, 0x214e, 0x214f, + 0x2150, 0x2151, 0x2152, 0x2153, 0x2154, 0x2155, 0x2156, 0x2157, + 0x2158, 0x2159, 0x215a, 0x215b, 0x215c, 0x215d, 0x215e, 0x215f, + 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, + 0x2178, 0x2179, 0x217a, 0x217b, 0x217c, 0x217d, 0x217e, 0x217f, + 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, + 0x2178, 0x2179, 0x217a, 0x217b, 0x217c, 0x217d, 0x217e, 0x217f, + 0x2180, 0x2181, 0x2182, 0x2184, 0x2184, 0x2185, 0x2186, 0x2187, + 0x2188, 0x2189, 0x218a, 0x218b, 0x218c, 0x218d, 0x218e, 0x218f, + 0x2190, 0x2191, 0x2192, 0x2193, 0x2194, 0x2195, 0x2196, 0x2197, + 0x2198, 0x2199, 0x219a, 0x219b, 0x219c, 0x219d, 0x219e, 0x219f, + 0x21a0, 0x21a1, 0x21a2, 0x21a3, 0x21a4, 0x21a5, 0x21a6, 0x21a7, + 0x21a8, 0x21a9, 0x21aa, 0x21ab, 0x21ac, 0x21ad, 0x21ae, 0x21af, + 0x21b0, 0x21b1, 0x21b2, 0x21b3, 0x21b4, 0x21b5, 0x21b6, 0x21b7, + 0x21b8, 0x21b9, 0x21ba, 0x21bb, 0x21bc, 0x21bd, 0x21be, 0x21bf, + 0x21c0, 0x21c1, 0x21c2, 0x21c3, 0x21c4, 0x21c5, 0x21c6, 0x21c7, + 0x21c8, 0x21c9, 0x21ca, 0x21cb, 0x21cc, 0x21cd, 0x21ce, 0x21cf, + 0x21d0, 0x21d1, 0x21d2, 0x21d3, 0x21d4, 0x21d5, 0x21d6, 0x21d7, + 0x21d8, 0x21d9, 0x21da, 0x21db, 0x21dc, 0x21dd, 0x21de, 0x21df, + 0x21e0, 0x21e1, 0x21e2, 0x21e3, 0x21e4, 0x21e5, 0x21e6, 0x21e7, + 0x21e8, 0x21e9, 0x21ea, 0x21eb, 0x21ec, 0x21ed, 0x21ee, 0x21ef, + 0x21f0, 0x21f1, 0x21f2, 0x21f3, 0x21f4, 0x21f5, 0x21f6, 0x21f7, + 0x21f8, 0x21f9, 0x21fa, 0x21fb, 0x21fc, 0x21fd, 0x21fe, 0x21ff, + + /* Characters U+2400 to U+24FF */ + + 0x2400, 0x2401, 0x2402, 0x2403, 0x2404, 0x2405, 0x2406, 0x2407, + 0x2408, 0x2409, 0x240a, 0x240b, 0x240c, 0x240d, 0x240e, 0x240f, + 0x2410, 0x2411, 0x2412, 0x2413, 0x2414, 0x2415, 0x2416, 0x2417, + 0x2418, 0x2419, 0x241a, 0x241b, 0x241c, 0x241d, 0x241e, 0x241f, + 0x2420, 0x2421, 0x2422, 0x2423, 0x2424, 0x2425, 0x2426, 0x2427, + 0x2428, 0x2429, 0x242a, 0x242b, 0x242c, 0x242d, 0x242e, 0x242f, + 0x2430, 0x2431, 0x2432, 0x2433, 0x2434, 0x2435, 0x2436, 0x2437, + 0x2438, 0x2439, 0x243a, 0x243b, 0x243c, 0x243d, 0x243e, 0x243f, + 0x2440, 0x2441, 0x2442, 0x2443, 0x2444, 0x2445, 0x2446, 0x2447, + 0x2448, 0x2449, 0x244a, 0x244b, 0x244c, 0x244d, 0x244e, 0x244f, + 0x2450, 0x2451, 0x2452, 0x2453, 0x2454, 0x2455, 0x2456, 0x2457, + 0x2458, 0x2459, 0x245a, 0x245b, 0x245c, 0x245d, 0x245e, 0x245f, + 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, + 0x2468, 0x2469, 0x246a, 0x246b, 0x246c, 0x246d, 0x246e, 0x246f, + 0x2470, 0x2471, 0x2472, 0x2473, 0x2474, 0x2475, 0x2476, 0x2477, + 0x2478, 0x2479, 0x247a, 0x247b, 0x247c, 0x247d, 0x247e, 0x247f, + 0x2480, 0x2481, 0x2482, 0x2483, 0x2484, 0x2485, 0x2486, 0x2487, + 0x2488, 0x2489, 0x248a, 0x248b, 0x248c, 0x248d, 0x248e, 0x248f, + 0x2490, 0x2491, 0x2492, 0x2493, 0x2494, 0x2495, 0x2496, 0x2497, + 0x2498, 0x2499, 0x249a, 0x249b, 0x249c, 0x249d, 0x249e, 0x249f, + 0x24a0, 0x24a1, 0x24a2, 0x24a3, 0x24a4, 0x24a5, 0x24a6, 0x24a7, + 0x24a8, 0x24a9, 0x24aa, 0x24ab, 0x24ac, 0x24ad, 0x24ae, 0x24af, + 0x24b0, 0x24b1, 0x24b2, 0x24b3, 0x24b4, 0x24b5, 0x24d0, 0x24d1, + 0x24d2, 0x24d3, 0x24d4, 0x24d5, 0x24d6, 0x24d7, 0x24d8, 0x24d9, + 0x24da, 0x24db, 0x24dc, 0x24dd, 0x24de, 0x24df, 0x24e0, 0x24e1, + 0x24e2, 0x24e3, 0x24e4, 0x24e5, 0x24e6, 0x24e7, 0x24e8, 0x24e9, + 0x24d0, 0x24d1, 0x24d2, 0x24d3, 0x24d4, 0x24d5, 0x24d6, 0x24d7, + 0x24d8, 0x24d9, 0x24da, 0x24db, 0x24dc, 0x24dd, 0x24de, 0x24df, + 0x24e0, 0x24e1, 0x24e2, 0x24e3, 0x24e4, 0x24e5, 0x24e6, 0x24e7, + 0x24e8, 0x24e9, 0x24ea, 0x24eb, 0x24ec, 0x24ed, 0x24ee, 0x24ef, + 0x24f0, 0x24f1, 0x24f2, 0x24f3, 0x24f4, 0x24f5, 0x24f6, 0x24f7, + 0x24f8, 0x24f9, 0x24fa, 0x24fb, 0x24fc, 0x24fd, 0x24fe, 0x24ff, + + /* Characters U+2C00 to U+2CFF */ + + 0x2c30, 0x2c31, 0x2c32, 0x2c33, 0x2c34, 0x2c35, 0x2c36, 0x2c37, + 0x2c38, 0x2c39, 0x2c3a, 0x2c3b, 0x2c3c, 0x2c3d, 0x2c3e, 0x2c3f, + 0x2c40, 0x2c41, 0x2c42, 0x2c43, 0x2c44, 0x2c45, 0x2c46, 0x2c47, + 0x2c48, 0x2c49, 0x2c4a, 0x2c4b, 0x2c4c, 0x2c4d, 0x2c4e, 0x2c4f, + 0x2c50, 0x2c51, 0x2c52, 0x2c53, 0x2c54, 0x2c55, 0x2c56, 0x2c57, + 0x2c58, 0x2c59, 0x2c5a, 0x2c5b, 0x2c5c, 0x2c5d, 0x2c5e, 0x2c2f, + 0x2c30, 0x2c31, 0x2c32, 0x2c33, 0x2c34, 0x2c35, 0x2c36, 0x2c37, + 0x2c38, 0x2c39, 0x2c3a, 0x2c3b, 0x2c3c, 0x2c3d, 0x2c3e, 0x2c3f, + 0x2c40, 0x2c41, 0x2c42, 0x2c43, 0x2c44, 0x2c45, 0x2c46, 0x2c47, + 0x2c48, 0x2c49, 0x2c4a, 0x2c4b, 0x2c4c, 0x2c4d, 0x2c4e, 0x2c4f, + 0x2c50, 0x2c51, 0x2c52, 0x2c53, 0x2c54, 0x2c55, 0x2c56, 0x2c57, + 0x2c58, 0x2c59, 0x2c5a, 0x2c5b, 0x2c5c, 0x2c5d, 0x2c5e, 0x2c5f, + 0x2c61, 0x2c61, 0x026b, 0x1d7d, 0x027d, 0x2c65, 0x2c66, 0x2c68, + 0x2c68, 0x2c6a, 0x2c6a, 0x2c6c, 0x2c6c, 0x2c6d, 0x2c6e, 0x2c6f, + 0x2c70, 0x2c71, 0x2c72, 0x2c73, 0x2c74, 0x2c76, 0x2c76, 0x2c77, + 0x2c78, 0x2c79, 0x2c7a, 0x2c7b, 0x2c7c, 0x2c7d, 0x2c7e, 0x2c7f, + 0x2c81, 0x2c81, 0x2c83, 0x2c83, 0x2c85, 0x2c85, 0x2c87, 0x2c87, + 0x2c89, 0x2c89, 0x2c8b, 0x2c8b, 0x2c8d, 0x2c8d, 0x2c8f, 0x2c8f, + 0x2c91, 0x2c91, 0x2c93, 0x2c93, 0x2c95, 0x2c95, 0x2c97, 0x2c97, + 0x2c99, 0x2c99, 0x2c9b, 0x2c9b, 0x2c9d, 0x2c9d, 0x2c9f, 0x2c9f, + 0x2ca1, 0x2ca1, 0x2ca3, 0x2ca3, 0x2ca5, 0x2ca5, 0x2ca7, 0x2ca7, + 0x2ca9, 0x2ca9, 0x2cab, 0x2cab, 0x2cad, 0x2cad, 0x2caf, 0x2caf, + 0x2cb1, 0x2cb1, 0x2cb3, 0x2cb3, 0x2cb5, 0x2cb5, 0x2cb7, 0x2cb7, + 0x2cb9, 0x2cb9, 0x2cbb, 0x2cbb, 0x2cbd, 0x2cbd, 0x2cbf, 0x2cbf, + 0x2cc1, 0x2cc1, 0x2cc3, 0x2cc3, 0x2cc5, 0x2cc5, 0x2cc7, 0x2cc7, + 0x2cc9, 0x2cc9, 0x2ccb, 0x2ccb, 0x2ccd, 0x2ccd, 0x2ccf, 0x2ccf, + 0x2cd1, 0x2cd1, 0x2cd3, 0x2cd3, 0x2cd5, 0x2cd5, 0x2cd7, 0x2cd7, + 0x2cd9, 0x2cd9, 0x2cdb, 0x2cdb, 0x2cdd, 0x2cdd, 0x2cdf, 0x2cdf, + 0x2ce1, 0x2ce1, 0x2ce3, 0x2ce3, 0x2ce4, 0x2ce5, 0x2ce6, 0x2ce7, + 0x2ce8, 0x2ce9, 0x2cea, 0x2ceb, 0x2cec, 0x2ced, 0x2cee, 0x2cef, + 0x2cf0, 0x2cf1, 0x2cf2, 0x2cf3, 0x2cf4, 0x2cf5, 0x2cf6, 0x2cf7, + 0x2cf8, 0x2cf9, 0x2cfa, 0x2cfb, 0x2cfc, 0x2cfd, 0x2cfe, 0x2cff, + + /* Characters U+FB00 to U+FBFF */ + + 0xe04d, 0xe04e, 0xe04f, 0xe40e, 0xe40f, 0xe050, 0xe051, 0xfb07, + 0xfb08, 0xfb09, 0xfb0a, 0xfb0b, 0xfb0c, 0xfb0d, 0xfb0e, 0xfb0f, + 0xfb10, 0xfb11, 0xfb12, 0xe052, 0xe053, 0xe054, 0xe055, 0xe056, + 0xfb18, 0xfb19, 0xfb1a, 0xfb1b, 0xfb1c, 0xfb1d, 0xfb1e, 0xfb1f, + 0xfb20, 0xfb21, 0xfb22, 0xfb23, 0xfb24, 0xfb25, 0xfb26, 0xfb27, + 0xfb28, 0xfb29, 0xfb2a, 0xfb2b, 0xfb2c, 0xfb2d, 0xfb2e, 0xfb2f, + 0xfb30, 0xfb31, 0xfb32, 0xfb33, 0xfb34, 0xfb35, 0xfb36, 0xfb37, + 0xfb38, 0xfb39, 0xfb3a, 0xfb3b, 0xfb3c, 0xfb3d, 0xfb3e, 0xfb3f, + 0xfb40, 0xfb41, 0xfb42, 0xfb43, 0xfb44, 0xfb45, 0xfb46, 0xfb47, + 0xfb48, 0xfb49, 0xfb4a, 0xfb4b, 0xfb4c, 0xfb4d, 0xfb4e, 0xfb4f, + 0xfb50, 0xfb51, 0xfb52, 0xfb53, 0xfb54, 0xfb55, 0xfb56, 0xfb57, + 0xfb58, 0xfb59, 0xfb5a, 0xfb5b, 0xfb5c, 0xfb5d, 0xfb5e, 0xfb5f, + 0xfb60, 0xfb61, 0xfb62, 0xfb63, 0xfb64, 0xfb65, 0xfb66, 0xfb67, + 0xfb68, 0xfb69, 0xfb6a, 0xfb6b, 0xfb6c, 0xfb6d, 0xfb6e, 0xfb6f, + 0xfb70, 0xfb71, 0xfb72, 0xfb73, 0xfb74, 0xfb75, 0xfb76, 0xfb77, + 0xfb78, 0xfb79, 0xfb7a, 0xfb7b, 0xfb7c, 0xfb7d, 0xfb7e, 0xfb7f, + 0xfb80, 0xfb81, 0xfb82, 0xfb83, 0xfb84, 0xfb85, 0xfb86, 0xfb87, + 0xfb88, 0xfb89, 0xfb8a, 0xfb8b, 0xfb8c, 0xfb8d, 0xfb8e, 0xfb8f, + 0xfb90, 0xfb91, 0xfb92, 0xfb93, 0xfb94, 0xfb95, 0xfb96, 0xfb97, + 0xfb98, 0xfb99, 0xfb9a, 0xfb9b, 0xfb9c, 0xfb9d, 0xfb9e, 0xfb9f, + 0xfba0, 0xfba1, 0xfba2, 0xfba3, 0xfba4, 0xfba5, 0xfba6, 0xfba7, + 0xfba8, 0xfba9, 0xfbaa, 0xfbab, 0xfbac, 0xfbad, 0xfbae, 0xfbaf, + 0xfbb0, 0xfbb1, 0xfbb2, 0xfbb3, 0xfbb4, 0xfbb5, 0xfbb6, 0xfbb7, + 0xfbb8, 0xfbb9, 0xfbba, 0xfbbb, 0xfbbc, 0xfbbd, 0xfbbe, 0xfbbf, + 0xfbc0, 0xfbc1, 0xfbc2, 0xfbc3, 0xfbc4, 0xfbc5, 0xfbc6, 0xfbc7, + 0xfbc8, 0xfbc9, 0xfbca, 0xfbcb, 0xfbcc, 0xfbcd, 0xfbce, 0xfbcf, + 0xfbd0, 0xfbd1, 0xfbd2, 0xfbd3, 0xfbd4, 0xfbd5, 0xfbd6, 0xfbd7, + 0xfbd8, 0xfbd9, 0xfbda, 0xfbdb, 0xfbdc, 0xfbdd, 0xfbde, 0xfbdf, + 0xfbe0, 0xfbe1, 0xfbe2, 0xfbe3, 0xfbe4, 0xfbe5, 0xfbe6, 0xfbe7, + 0xfbe8, 0xfbe9, 0xfbea, 0xfbeb, 0xfbec, 0xfbed, 0xfbee, 0xfbef, + 0xfbf0, 0xfbf1, 0xfbf2, 0xfbf3, 0xfbf4, 0xfbf5, 0xfbf6, 0xfbf7, + 0xfbf8, 0xfbf9, 0xfbfa, 0xfbfb, 0xfbfc, 0xfbfd, 0xfbfe, 0xfbff, + + /* Characters U+FF00 to U+FFFF */ + + 0xff00, 0xff01, 0xff02, 0xff03, 0xff04, 0xff05, 0xff06, 0xff07, + 0xff08, 0xff09, 0xff0a, 0xff0b, 0xff0c, 0xff0d, 0xff0e, 0xff0f, + 0xff10, 0xff11, 0xff12, 0xff13, 0xff14, 0xff15, 0xff16, 0xff17, + 0xff18, 0xff19, 0xff1a, 0xff1b, 0xff1c, 0xff1d, 0xff1e, 0xff1f, + 0xff20, 0xff41, 0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47, + 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f, + 0xff50, 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, 0xff56, 0xff57, + 0xff58, 0xff59, 0xff5a, 0xff3b, 0xff3c, 0xff3d, 0xff3e, 0xff3f, + 0xff40, 0xff41, 0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47, + 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f, + 0xff50, 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, 0xff56, 0xff57, + 0xff58, 0xff59, 0xff5a, 0xff5b, 0xff5c, 0xff5d, 0xff5e, 0xff5f, + 0xff60, 0xff61, 0xff62, 0xff63, 0xff64, 0xff65, 0xff66, 0xff67, + 0xff68, 0xff69, 0xff6a, 0xff6b, 0xff6c, 0xff6d, 0xff6e, 0xff6f, + 0xff70, 0xff71, 0xff72, 0xff73, 0xff74, 0xff75, 0xff76, 0xff77, + 0xff78, 0xff79, 0xff7a, 0xff7b, 0xff7c, 0xff7d, 0xff7e, 0xff7f, + 0xff80, 0xff81, 0xff82, 0xff83, 0xff84, 0xff85, 0xff86, 0xff87, + 0xff88, 0xff89, 0xff8a, 0xff8b, 0xff8c, 0xff8d, 0xff8e, 0xff8f, + 0xff90, 0xff91, 0xff92, 0xff93, 0xff94, 0xff95, 0xff96, 0xff97, + 0xff98, 0xff99, 0xff9a, 0xff9b, 0xff9c, 0xff9d, 0xff9e, 0xff9f, + 0xffa0, 0xffa1, 0xffa2, 0xffa3, 0xffa4, 0xffa5, 0xffa6, 0xffa7, + 0xffa8, 0xffa9, 0xffaa, 0xffab, 0xffac, 0xffad, 0xffae, 0xffaf, + 0xffb0, 0xffb1, 0xffb2, 0xffb3, 0xffb4, 0xffb5, 0xffb6, 0xffb7, + 0xffb8, 0xffb9, 0xffba, 0xffbb, 0xffbc, 0xffbd, 0xffbe, 0xffbf, + 0xffc0, 0xffc1, 0xffc2, 0xffc3, 0xffc4, 0xffc5, 0xffc6, 0xffc7, + 0xffc8, 0xffc9, 0xffca, 0xffcb, 0xffcc, 0xffcd, 0xffce, 0xffcf, + 0xffd0, 0xffd1, 0xffd2, 0xffd3, 0xffd4, 0xffd5, 0xffd6, 0xffd7, + 0xffd8, 0xffd9, 0xffda, 0xffdb, 0xffdc, 0xffdd, 0xffde, 0xffdf, + 0xffe0, 0xffe1, 0xffe2, 0xffe3, 0xffe4, 0xffe5, 0xffe6, 0xffe7, + 0xffe8, 0xffe9, 0xffea, 0xffeb, 0xffec, 0xffed, 0xffee, 0xffef, + 0xfff0, 0xfff1, 0xfff2, 0xfff3, 0xfff4, 0xfff5, 0xfff6, 0xfff7, + 0xfff8, 0xfff9, 0xfffa, 0xfffb, 0xfffc, 0xfffd, 0xfffe, 0xffff, +}; + +__uint16_t xfs_case_fold_double_table[87][2] =3D { + /* U+00DF */ {0x0073, 0x0073}, /* U+0130 */ {0x0069, 0x0307}, + /* U+0149 */ {0x02bc, 0x006e}, /* U+01F0 */ {0x006a, 0x030c}, + /* U+0587 */ {0x0565, 0x0582}, /* U+1E96 */ {0x0068, 0x0331}, + /* U+1E97 */ {0x0074, 0x0308}, /* U+1E98 */ {0x0077, 0x030a}, + /* U+1E99 */ {0x0079, 0x030a}, /* U+1E9A */ {0x0061, 0x02be}, + /* U+1F50 */ {0x03c5, 0x0313}, /* U+1F80 */ {0x1f00, 0x03b9}, + /* U+1F81 */ {0x1f01, 0x03b9}, /* U+1F82 */ {0x1f02, 0x03b9}, + /* U+1F83 */ {0x1f03, 0x03b9}, /* U+1F84 */ {0x1f04, 0x03b9}, + /* U+1F85 */ {0x1f05, 0x03b9}, /* U+1F86 */ {0x1f06, 0x03b9}, + /* U+1F87 */ {0x1f07, 0x03b9}, /* U+1F88 */ {0x1f00, 0x03b9}, + /* U+1F89 */ {0x1f01, 0x03b9}, /* U+1F8A */ {0x1f02, 0x03b9}, + /* U+1F8B */ {0x1f03, 0x03b9}, /* U+1F8C */ {0x1f04, 0x03b9}, + /* U+1F8D */ {0x1f05, 0x03b9}, /* U+1F8E */ {0x1f06, 0x03b9}, + /* U+1F8F */ {0x1f07, 0x03b9}, /* U+1F90 */ {0x1f20, 0x03b9}, + /* U+1F91 */ {0x1f21, 0x03b9}, /* U+1F92 */ {0x1f22, 0x03b9}, + /* U+1F93 */ {0x1f23, 0x03b9}, /* U+1F94 */ {0x1f24, 0x03b9}, + /* U+1F95 */ {0x1f25, 0x03b9}, /* U+1F96 */ {0x1f26, 0x03b9}, + /* U+1F97 */ {0x1f27, 0x03b9}, /* U+1F98 */ {0x1f20, 0x03b9}, + /* U+1F99 */ {0x1f21, 0x03b9}, /* U+1F9A */ {0x1f22, 0x03b9}, + /* U+1F9B */ {0x1f23, 0x03b9}, /* U+1F9C */ {0x1f24, 0x03b9}, + /* U+1F9D */ {0x1f25, 0x03b9}, /* U+1F9E */ {0x1f26, 0x03b9}, + /* U+1F9F */ {0x1f27, 0x03b9}, /* U+1FA0 */ {0x1f60, 0x03b9}, + /* U+1FA1 */ {0x1f61, 0x03b9}, /* U+1FA2 */ {0x1f62, 0x03b9}, + /* U+1FA3 */ {0x1f63, 0x03b9}, /* U+1FA4 */ {0x1f64, 0x03b9}, + /* U+1FA5 */ {0x1f65, 0x03b9}, /* U+1FA6 */ {0x1f66, 0x03b9}, + /* U+1FA7 */ {0x1f67, 0x03b9}, /* U+1FA8 */ {0x1f60, 0x03b9}, + /* U+1FA9 */ {0x1f61, 0x03b9}, /* U+1FAA */ {0x1f62, 0x03b9}, + /* U+1FAB */ {0x1f63, 0x03b9}, /* U+1FAC */ {0x1f64, 0x03b9}, + /* U+1FAD */ {0x1f65, 0x03b9}, /* U+1FAE */ {0x1f66, 0x03b9}, + /* U+1FAF */ {0x1f67, 0x03b9}, /* U+1FB2 */ {0x1f70, 0x03b9}, + /* U+1FB3 */ {0x03b1, 0x03b9}, /* U+1FB4 */ {0x03ac, 0x03b9}, + /* U+1FB6 */ {0x03b1, 0x0342}, /* U+1FBC */ {0x03b1, 0x03b9}, + /* U+1FC2 */ {0x1f74, 0x03b9}, /* U+1FC3 */ {0x03b7, 0x03b9}, + /* U+1FC4 */ {0x03ae, 0x03b9}, /* U+1FC6 */ {0x03b7, 0x0342}, + /* U+1FCC */ {0x03b7, 0x03b9}, /* U+1FD6 */ {0x03b9, 0x0342}, + /* U+1FE4 */ {0x03c1, 0x0313}, /* U+1FE6 */ {0x03c5, 0x0342}, + /* U+1FF2 */ {0x1f7c, 0x03b9}, /* U+1FF3 */ {0x03c9, 0x03b9}, + /* U+1FF4 */ {0x03ce, 0x03b9}, /* U+1FF6 */ {0x03c9, 0x0342}, + /* U+1FFC */ {0x03c9, 0x03b9}, /* U+FB00 */ {0x0066, 0x0066}, + /* U+FB01 */ {0x0066, 0x0069}, /* U+FB02 */ {0x0066, 0x006c}, + /* U+FB05 */ {0x0073, 0x0074}, /* U+FB06 */ {0x0073, 0x0074}, + /* U+FB13 */ {0x0574, 0x0576}, /* U+FB14 */ {0x0574, 0x0565}, + /* U+FB15 */ {0x0574, 0x056b}, /* U+FB16 */ {0x057e, 0x0576}, + /* U+FB17 */ {0x0574, 0x056d}, +}; + +__uint16_t xfs_case_fold_triple_table[16][3] =3D { + /* U+0390 */ {0x03b9, 0x0308, 0x0301}, + /* U+03B0 */ {0x03c5, 0x0308, 0x0301}, + /* U+1F52 */ {0x03c5, 0x0313, 0x0300}, + /* U+1F54 */ {0x03c5, 0x0313, 0x0301}, + /* U+1F56 */ {0x03c5, 0x0313, 0x0342}, + /* U+1FB7 */ {0x03b1, 0x0342, 0x03b9}, + /* U+1FC7 */ {0x03b7, 0x0342, 0x03b9}, + /* U+1FD2 */ {0x03b9, 0x0308, 0x0300}, + /* U+1FD3 */ {0x03b9, 0x0308, 0x0301}, + /* U+1FD7 */ {0x03b9, 0x0308, 0x0342}, + /* U+1FE2 */ {0x03c5, 0x0308, 0x0300}, + /* U+1FE3 */ {0x03c5, 0x0308, 0x0301}, + /* U+1FE7 */ {0x03c5, 0x0308, 0x0342}, + /* U+1FF7 */ {0x03c9, 0x0342, 0x03b9}, + /* U+FB03 */ {0x0066, 0x0066, 0x0069}, + /* U+FB04 */ {0x0066, 0x0066, 0x006c}, +}; + +static __uint16_t xfs_case_fold_turkic_adjust[2][2] =3D { + {0x0049, 0x0131}, {0x0130, 0x0069}, +}; + +#define NUM_CFT 3 + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#endif + +int +libxfs_create_casefoldtable( + xfs_mount_t *mp, + int isturkic) +{ + int i; + xfs_dcft_t *table; + int table_size; + __be16 *cfc; + xfs_trans_t *tp; + xfs_inode_t *cftip; + struct cred creds; + struct fsxattr fsxattrs; + xfs_dfiloff_t bno; + int committed; + xfs_bmbt_irec_t *ep; + int error; + xfs_fsblock_t first; + xfs_bmap_free_t flist; + xfs_bmbt_irec_t map[XFS_BMAP_MAX_NMAP]; + xfs_extlen_t nblocks; + int nmap; + char *p; + xfs_buf_t *bp; + + if (!xfs_sb_version_hasunicode(&mp->m_sb)) + return 0; + + /* + * setup on-disk table in a memory buffer + */ + table_size =3D sizeof(xfs_dcft_t) + sizeof(__be32) * (NUM_CFT - 1) + + sizeof(xfs_case_fold_table) + + sizeof(xfs_case_fold_double_table) + + sizeof(xfs_case_fold_triple_table); + nblocks =3D XFS_B_TO_FSB(mp, table_size); + table =3D calloc(1, XFS_FSB_TO_B(mp, nblocks)); + table->cft_magic =3D cpu_to_be32(XFS_CFT_MAGIC); + platform_uuid_copy(&table->cft_uuid, &mp->m_sb.sb_uuid); + table->cft_num_tables =3D cpu_to_be32(NUM_CFT); + table->cft_table_offset[0] =3D cpu_to_be32(sizeof(xfs_dcft_t) + + sizeof(__be32) * (NUM_CFT - 1)); + table->cft_table_offset[1] =3D cpu_to_be32(sizeof(xfs_dcft_t) + + sizeof(__be32) * (NUM_CFT - 1) + + sizeof(xfs_case_fold_table)); + table->cft_table_offset[2] =3D cpu_to_be32(sizeof(xfs_dcft_t) + + sizeof(__be32) * (NUM_CFT - 1) + + sizeof(xfs_case_fold_table) + + sizeof(xfs_case_fold_double_table)); + /* if user wants turkic case folding, adjust table first */ + if (isturkic) { + table->cft_flags |=3D cpu_to_be32(XFS_CFT_FLAG_TURKIC); + for (i =3D 0; i < ARRAY_SIZE(xfs_case_fold_turkic_adjust); i++) { + __uint16_t tmp =3D xfs_case_fold_table[ + xfs_case_fold_turkic_adjust[i][0] >> 8]; + xfs_case_fold_table[tmp + + (xfs_case_fold_turkic_adjust[i][0] & 0xff)] =3D + xfs_case_fold_turkic_adjust[i][1]; + } + } + cfc =3D XFS_DCFT_PTR(table, 0); + for (i =3D 0; i < ARRAY_SIZE(xfs_case_fold_table); i++) + *cfc++ =3D cpu_to_be16(xfs_case_fold_table[i]); + ASSERT(cfc =3D=3D XFS_DCFT_PTR(table, 1)); + for (i =3D 0; i < ARRAY_SIZE(xfs_case_fold_double_table); i++) { + *cfc++ =3D cpu_to_be16(xfs_case_fold_double_table[i][0]); + *cfc++ =3D cpu_to_be16(xfs_case_fold_double_table[i][1]); + } + ASSERT(cfc =3D=3D XFS_DCFT_PTR(table, 2)); + for (i =3D 0; i < ARRAY_SIZE(xfs_case_fold_triple_table); i++) { + *cfc++ =3D cpu_to_be16(xfs_case_fold_triple_table[i][0]); + *cfc++ =3D cpu_to_be16(xfs_case_fold_triple_table[i][1]); + *cfc++ =3D cpu_to_be16(xfs_case_fold_triple_table[i][2]); + } + + /* + * allocate the inode + */ + tp =3D libxfs_trans_alloc(mp, 0); + error =3D libxfs_trans_reserve(tp, XFS_CREATE_LOG_RES(mp), 0, 0, 0, 0= ); + if (error) { + fprintf(stderr, _("%s: cannot reserve space: %s\n"), + progname, strerror(error)); + exit(1); + } + bzero(&creds, sizeof(creds)); + bzero(&fsxattrs, sizeof(fsxattrs)); + error =3D libxfs_inode_alloc(&tp, NULL, S_IFREG, 1, 0, + &creds, &fsxattrs, &cftip); + if (error) + goto err_out; + mp->m_sb.sb_cftino =3D cftip->i_ino; + cftip->i_d.di_size =3D table_size; + libxfs_trans_log_inode(tp, cftip, XFS_ILOG_CORE); + libxfs_mod_sb(tp, XFS_SB_CFTINO); + libxfs_trans_ihold(tp, cftip); + libxfs_trans_commit(tp, 0, NULL); + + /* + * write case table to inode + */ + tp =3D libxfs_trans_alloc(mp, 0); + error =3D libxfs_trans_reserve(tp, + nblocks + (XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) - 1), + 0, 0, 0, 0); + if (error) { + fprintf(stderr, _("%s: cannot reserve space: %s\n"), + progname, strerror(error)); + exit(1); + } + libxfs_trans_ijoin(tp, cftip, 0); + bno =3D 0; + p =3D (char *)table; + XFS_BMAP_INIT(&flist, &first); + while (bno < nblocks) { + nmap =3D XFS_BMAP_MAX_NMAP; + error =3D libxfs_bmapi(tp, cftip, bno, + (xfs_extlen_t)(nblocks - bno), + XFS_BMAPI_WRITE, &first, nblocks, + map, &nmap, &flist); + if (error) + goto err_out; + for (i =3D 0, ep =3D map; i < nmap; i++, ep++) { + bp =3D libxfs_getbuf(mp->m_dev, + XFS_FSB_TO_DADDR(mp, ep->br_startblock), + XFS_FSB_TO_BB(mp, ep->br_blockcount)); + memcpy(XFS_BUF_PTR(bp), p, XFS_BUF_SIZE(bp)); + libxfs_writebuf(bp, 0); + bno +=3D ep->br_blockcount; + p +=3D XFS_BUF_SIZE(bp); + } + } + error =3D libxfs_bmap_finish(&tp, &flist, first, &committed); + if (error) + goto err_out; + libxfs_trans_commit(tp, 0, NULL); + free(table); + return 0; + +err_out: + libxfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES); + free(table); + return error; +} Index: ci/xfsprogs/libxfs/xfs_mount.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/libxfs/xfs_mount.c 2008-01-18 14:50:42.000000000 +1= 100 +++ ci/xfsprogs/libxfs/xfs_mount.c 2008-01-18 15:00:08.836596146 +1100 @@ -140,6 +140,8 @@ { offsetof(xfs_sb_t, sb_logsectsize),0 }, { offsetof(xfs_sb_t, sb_logsunit), 0 }, { offsetof(xfs_sb_t, sb_features2), 0 }, + { offsetof(xfs_sb_t, sb_bad_features2), 0 }, + { offsetof(xfs_sb_t, sb_cftino), 0 }, { sizeof(xfs_sb_t), 0 } }; = Index: ci/xfsprogs/mkfs/proto.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/mkfs/proto.c 2008-01-18 14:50:42.000000000 +1100 +++ ci/xfsprogs/mkfs/proto.c 2008-01-18 15:00:08.912586396 +1100 @@ -18,6 +18,7 @@ = #include #include +#include #include "xfs_mkfs.h" = /* @@ -32,6 +33,7 @@ xfs_fsblock_t *first, int dolocal, int logit, char *buf, int len); static char *newregfile(char **pp, int *len); static void rtinit(xfs_mount_t *mp); +static void cftinit(xfs_mount_t *mp); static long filesize(int fd); = /* @@ -570,11 +572,13 @@ libxfs_trans_ihold(tp, ip); libxfs_trans_commit(tp, 0, NULL); /* - * RT initialization. Do this here to ensure that - * the RT inodes get placed after the root inode. + * RT & CFT initialization. Do this here to ensure that + * the RT & CFT inodes get placed after the root inode. */ - if (isroot) + if (isroot) { rtinit(mp); + cftinit(mp); + } tp =3D NULL; for (;;) { name =3D getstr(pp); @@ -762,6 +766,20 @@ } } = +/* + * Allocate unicode case folding table + */ + +static void +cftinit( + xfs_mount_t *mp) +{ + int error =3D libxfs_create_casefoldtable(mp, + mp->m_flags & LIBXFS_MOUNT_FLAG_TURKIC_CASE); + if (error) + fail(_("Creating the case folding table failed"), error); +} + static long filesize( int fd) Index: ci/xfsprogs/mkfs/xfs_mkfs.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/mkfs/xfs_mkfs.c 2008-01-18 14:50:42.000000000 +1100= +++ ci/xfsprogs/mkfs/xfs_mkfs.c 2008-01-18 15:00:08.916585883 +1100 @@ -128,6 +128,8 @@ "size", #define N_VERSION 2 "version", +#define N_UTF8 3 + "utf8", NULL, }; = @@ -635,7 +637,6 @@ char *dfile; int dirblocklog; int dirblocksize; - int dirversion; char *dsize; int dsu; int dsw; @@ -683,6 +684,8 @@ xfs_alloc_rec_t *nrec; int nsflag; int nvflag; + int nci; + int nutf8; int Nflag; char *p; char *protofile; @@ -707,12 +710,20 @@ int xlv_dsunit; int xlv_dswidth; int lazy_sb_counters; + char *locale; + int isturkiclocale; + = progname =3D basename(argv[0]); - setlocale(LC_ALL, ""); + locale =3D setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); = + isturkiclocale =3D strncasecmp(locale, "az_", 3) =3D=3D 0 || + strncasecmp(locale, "aze_", 4) =3D=3D 0 || + strncasecmp(locale, "tr_", 3) =3D=3D 0 || + strncasecmp(locale, "tur_", 4) =3D=3D 0; + attrversion =3D 2; blflag =3D bsflag =3D slflag =3D ssflag =3D lslflag =3D lssflag =3D 0;= blocklog =3D blocksize =3D 0; @@ -724,8 +735,8 @@ loginternal =3D 1; logversion =3D 2; logagno =3D logblocks =3D rtblocks =3D rtextblocks =3D 0; - Nflag =3D nlflag =3D nsflag =3D nvflag =3D 0; - dirblocklog =3D dirblocksize =3D dirversion =3D 0; + Nflag =3D nlflag =3D nsflag =3D nvflag =3D nci =3D nutf8 =3D 0; + dirblocklog =3D dirblocksize =3D 0; qflag =3D 0; imaxpct =3D inodelog =3D inopblock =3D isize =3D 0; iaflag =3D XFS_IFLAG_ALIGN; @@ -1240,11 +1251,27 @@ reqval('n', nopts, N_VERSION); if (nvflag) respec('n', nopts, N_VERSION); - dirversion =3D atoi(value); - if (dirversion < 1 || dirversion > 2) - illegal(value, "n version"); + if (!strcmp(value, "ci")) { + nci =3D 1; /* old-style CI mode */ + } else { + if (atoi(value) !=3D XFS_DFL_DIR_VERSION) + illegal(value, + "n version"); + } nvflag =3D 1; break; + case N_UTF8: + if (value) { + if (!strcmp(value, "turkic")) + nutf8 =3D 2; + else + if (!strcmp(value, "default")) + nutf8 =3D 1; + else + illegal(value, "n utf8"); + } else + nutf8 =3D isturkiclocale ? 2 : 1; + break; default: unknown('n', value); } @@ -1416,33 +1443,24 @@ logversion =3D 2; } = - if (!nvflag) - dirversion =3D (nsflag || nlflag) ? 2 : XFS_DFL_DIR_VERSION; - switch (dirversion) { - case 1: - if ((nsflag || nlflag) && dirblocklog !=3D blocklog) { + if (nsflag || nlflag) { + if (dirblocksize < blocksize || + dirblocksize > XFS_MAX_BLOCKSIZE) { fprintf(stderr, _("illegal directory block size %d\n"), dirblocksize); usage(); } - break; - case 2: - if (nsflag || nlflag) { - if (dirblocksize < blocksize || - dirblocksize > XFS_MAX_BLOCKSIZE) { - fprintf(stderr, - _("illegal directory block size %d\n"), - dirblocksize); - usage(); - } - } else { - if (blocksize < (1 << XFS_MIN_REC_DIRSIZE)) - dirblocklog =3D XFS_MIN_REC_DIRSIZE; - else - dirblocklog =3D blocklog; - dirblocksize =3D 1 << dirblocklog; - } - break; + } else { + if (blocksize < (1 << XFS_MIN_REC_DIRSIZE)) + dirblocklog =3D XFS_MIN_REC_DIRSIZE; + else + dirblocklog =3D blocklog; + dirblocksize =3D 1 << dirblocklog; + } + if (nci && nutf8) { + fprintf(stderr, + _("both -n version=3Dci and utf8=3D specified, use one or the other\n"= )); + usage(); } = if (daflag && dasize) { @@ -1717,7 +1735,7 @@ sectorsize, xi.rtbsize); } = - max_tr_res =3D max_trans_res(dirversion, + max_tr_res =3D max_trans_res(XFS_DFL_DIR_VERSION, sectorlog, blocklog, inodelog, dirblocklog); ASSERT(max_tr_res); min_logblocks =3D max_tr_res * XFS_MIN_LOG_FACTOR; @@ -2022,7 +2040,7 @@ " =3D%-22s sectsz=3D%-5u attr=3D%u\n" "data =3D%-22s bsize=3D%-6u blocks=3D%llu, imaxpct=3D%u\n" " =3D%-22s sunit=3D%-6u swidth=3D%u blks\n" - "naming =3Dversion %-14u bsize=3D%-6u\n" + "naming =3Dversion %-14s bsize=3D%-6u utf8=3D%s\n" "log =3D%-22s bsize=3D%-6d blocks=3D%lld, version=3D%d\n" " =3D%-22s sectsz=3D%-5u sunit=3D%d blks, lazy-count=3D%d\= n" "realtime =3D%-22s extsz=3D%-6d blocks=3D%lld, rtextents=3D%lld\n"= ), @@ -2031,7 +2049,8 @@ "", blocksize, (long long)dblocks, calc_default_imaxpct(blocklog, dblocks), "", dsunit, dswidth, - dirversion, dirversion =3D=3D 1 ? blocksize : dirblocksize, + nci ? "ci" : "2" /*dirversion*/, dirblocksize, + nutf8 =3D=3D 0 ? "none" : nutf8 =3D=3D 2 ? "turkic" : "default", logfile, 1 << blocklog, (long long)logblocks, logversion, "", lsectorsize, lsunit, lazy_sb_counters, rtfile, rtextblocks << blocklog, @@ -2076,8 +2095,7 @@ sbp->sb_qflags =3D 0; sbp->sb_unit =3D dsunit; sbp->sb_width =3D dswidth; - if (dirversion =3D=3D 2) - sbp->sb_dirblklog =3D dirblocklog - blocklog; + sbp->sb_dirblklog =3D dirblocklog - blocklog; if (logversion =3D=3D 2) { /* This is stored in bytes */ lsunit =3D (lsunit =3D=3D 0) ? 1 : XFS_FSB_TO_B(mp, lsunit); sbp->sb_logsunit =3D lsunit; @@ -2095,12 +2113,13 @@ sbp->sb_logsectlog =3D 0; sbp->sb_logsectsize =3D 0; } - sbp->sb_features2 =3D XFS_SB_VERSION2_MKFS(lazy_sb_counters, attrversi= on =3D=3D 2, 0); + sbp->sb_features2 =3D XFS_SB_VERSION2_MKFS(lazy_sb_counters, + attrversion =3D=3D 2, 0, nutf8 !=3D 0); sbp->sb_versionnum =3D XFS_SB_VERSION_MKFS( - iaflag, dsunit !=3D 0, - dirversion =3D=3D 2, logversion =3D=3D 2, attrversion =3D=3D 1, + iaflag, dsunit !=3D 0, logversion =3D=3D 2, attrversion =3D=3D 1, (sectorsize !=3D BBSIZE || lsectorsize !=3D BBSIZE), - sbp->sb_features2 !=3D 0); + nci !=3D 0, sbp->sb_features2 !=3D 0); + sbp->sb_cftino =3D 0; = if (force_overwrite) zero_old_xfs_structures(&xi, sbp); @@ -2162,6 +2181,8 @@ progname); exit(1); } + if (nutf8 =3D=3D 2) + mp->m_flags |=3D LIBXFS_MOUNT_FLAG_TURKIC_CASE; = for (agno =3D 0; agno < agcount; agno++) { /* @@ -2574,7 +2595,7 @@ sunit=3Dvalue|su=3Dnum,sectlog=3Dn|sectsize=3Dnum,\n\ lazy-count=3D0|1]\n\ /* label */ [-L label (maximum 12 characters)]\n\ -/* naming */ [-n log=3Dn|size=3Dnum,version=3Dn]\n\ +/* naming */ [-n log=3Dn|size=3Dnum,version=3Dn,utf8=3Dnone|default|tu= rkic]\n\ /* prototype file */ [-p fname]\n\ /* quiet */ [-q]\n\ /* realtime subvol */ [-r extsize=3Dnum,size=3Dnum,rtdev=3Dxxx]\n\ Index: ci/xfsprogs/mkfs/xfs_mkfs.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/mkfs/xfs_mkfs.h 2008-01-18 14:50:42.000000000 +1100= +++ ci/xfsprogs/mkfs/xfs_mkfs.h 2008-01-18 15:00:08.924584857 +1100 @@ -20,25 +20,27 @@ = #define XFS_DFL_SB_VERSION_BITS \ (XFS_SB_VERSION_NLINKBIT | \ - XFS_SB_VERSION_EXTFLGBIT) + XFS_SB_VERSION_EXTFLGBIT | \ + XFS_SB_VERSION_DIRV2BIT) = -#define XFS_SB_VERSION_MKFS(ia,dia,dir2,log2,attr1,sflag,more) (\ - ((ia)||(dia)||(dir2)||(log2)||(attr1)||(sflag)||(more)) ? \ +#define XFS_SB_VERSION_MKFS(ia,dia,log2,attr1,sflag,ci,more) (\ + ((ia)||(dia)||(log2)||(attr1)||(sflag)||(more)) ? \ ( XFS_SB_VERSION_4 | \ ((ia) ? XFS_SB_VERSION_ALIGNBIT : 0) | \ ((dia) ? XFS_SB_VERSION_DALIGNBIT : 0) | \ - ((dir2) ? XFS_SB_VERSION_DIRV2BIT : 0) | \ ((log2) ? XFS_SB_VERSION_LOGV2BIT : 0) | \ ((attr1) ? XFS_SB_VERSION_ATTRBIT : 0) | \ ((sflag) ? XFS_SB_VERSION_SECTORBIT : 0) | \ + ((ci) ? XFS_SB_VERSION_OLDCIBIT : 0) | \ ((more) ? XFS_SB_VERSION_MOREBITSBIT : 0) | \ XFS_DFL_SB_VERSION_BITS | \ 0 ) : XFS_SB_VERSION_1 ) = -#define XFS_SB_VERSION2_MKFS(lazycount, attr2, parent) (\ +#define XFS_SB_VERSION2_MKFS(lazycount, attr2, parent, unicode) (\ ((lazycount) ? XFS_SB_VERSION2_LAZYSBCOUNTBIT : 0) | \ ((attr2) ? XFS_SB_VERSION2_ATTR2BIT : 0) | \ ((parent) ? XFS_SB_VERSION2_PARENTBIT : 0) | \ + ((unicode) ? XFS_SB_VERSION2_UNICODEBIT : 0) | \ 0 ) = #define XFS_DFL_BLOCKSIZE_LOG 12 /* 4096 byte blocks */ @@ -65,6 +67,7 @@ = #define XFS_MAX_AGNUMBER ((xfs_agnumber_t)(NULLAGNUMBER - 1)) = +#define LIBXFS_MOUNT_FLAG_TURKIC_CASE 0x1000 /* use turkic casefold tab= le */ = /* xfs_mkfs.c */ extern void usage (void); Index: ci/xfsprogs/repair/agheader.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/repair/agheader.c 2008-01-18 14:50:42.000000000 +11= 00 +++ ci/xfsprogs/repair/agheader.c 2008-01-18 15:00:08.984577159 +1100 @@ -245,10 +245,14 @@ * work against older filesystems when the superblock * gets rev'ed again with new fields appended. */ - if (XFS_SB_VERSION_HASMOREBITS(sb)) - size =3D (__psint_t)&sb->sb_features2 - + sizeof(sb->sb_features2) - (__psint_t)sb; - else if (XFS_SB_VERSION_HASLOGV2(sb)) + if (XFS_SB_VERSION_HASMOREBITS(sb)) { + if (xfs_sb_version_hasunicode(sb)) + size =3D (__psint_t)&sb->sb_cftino + + sizeof(sb->sb_cftino) - (__psint_t)sb; + else + size =3D (__psint_t)&sb->sb_features2 + + sizeof(sb->sb_features2) - (__psint_t)sb; + } else if (XFS_SB_VERSION_HASLOGV2(sb)) size =3D (__psint_t)&sb->sb_logsunit + sizeof(sb->sb_logsunit) - (__psint_t)sb; else if (XFS_SB_VERSION_HASSECTOR(sb)) Index: ci/xfsprogs/repair/dir2.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/repair/dir2.c 2008-01-18 14:50:42.000000000 +1100 +++ ci/xfsprogs/repair/dir2.c 2008-01-18 15:00:09.004574594 +1100 @@ -932,6 +932,9 @@ } else if (lino =3D=3D mp->m_sb.sb_gquotino) { junkit =3D 1; junkreason =3D _("group quota"); + } else if (lino =3D=3D mp->m_sb.sb_cftino) { + junkit =3D 1; + junkreason =3D _("casefold table"); } else if ((irec_p =3D find_inode_rec(XFS_INO_TO_AGNO(mp, lino), XFS_INO_TO_AGINO(mp, lino))) !=3D NULL) { /* Index: ci/xfsprogs/repair/incore.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/repair/incore.h 2008-01-18 14:50:42.000000000 +1100= +++ ci/xfsprogs/repair/incore.h 2008-01-18 15:00:09.012573567 +1100 @@ -307,6 +307,7 @@ #define XR_INO_SOCK 9 /* socket */ #define XR_INO_FIFO 10 /* fifo */ #define XR_INO_MOUNTPOINT 11 /* mountpoint */ +#define XR_INO_CFT 12 /* casefold table */ = /* inode allocation tree */ = Index: ci/xfsprogs/repair/phase6.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/repair/phase6.c 2008-01-18 14:50:42.000000000 +1100= +++ ci/xfsprogs/repair/phase6.c 2008-01-18 15:00:09.016573054 +1100 @@ -17,6 +17,7 @@ */ = #include +#include #include "avl.h" #include "globals.h" #include "agheader.h" @@ -94,6 +95,7 @@ static int dir_hash_add( dir_hash_tab_t *hashtab, + xfs_inode_t *ip, __uint32_t addr, xfs_ino_t inum, int namelen, @@ -113,7 +115,7 @@ dup =3D 0; = if (!junk) { - hash =3D libxfs_da_hashname(name, namelen); + hash =3D xfs_dir_hashname(ip, name, namelen); byhash =3D DIR_HASH_FUNC(hashtab, hash); = /* @@ -797,6 +799,18 @@ } = /* + * Makes new case fold table. Default it to a normal table and do check= s + * during the hashing for possible turkic case, and adjust then if requ= ired. + */ +void +mk_cftino(xfs_mount_t *mp) +{ + int error =3D libxfs_create_casefoldtable(mp, 0); + if (error) + do_error(_("Creating the casefold table failed"), error); +} + +/* * orphanage name =3D=3D lost+found */ xfs_ino_t @@ -1092,7 +1106,6 @@ */ static xfs_dfsbno_t map_first_dblock_fsbno(xfs_mount_t *mp, - xfs_ino_t ino, xfs_inode_t *ip, xfs_dablk_t *bno) { @@ -1127,11 +1140,11 @@ if (!no_modify) do_error( _("can't map block %d in %s inode %llu, xfs_bmapi returns %d, nmap =3D = %d\n"), - da_bno, ftype, ino, error, nmap); + da_bno, ftype, ip->i_ino, error, nmap); else { do_warn( _("can't map block %d in %s inode %llu, xfs_bmapi returns %d, nmap =3D = %d\n"), - da_bno, ftype, ino, error, nmap); + da_bno, ftype, ip->i_ino, error, nmap); return(NULLDFSBNO); } } @@ -1139,10 +1152,10 @@ if ((fsbno =3D map.br_startblock) =3D=3D HOLESTARTBLOCK) { if (!no_modify) do_error(_("block %d in %s ino %llu doesn't exist\n"), - da_bno, ftype, ino); + da_bno, ftype, ip->i_ino); else { do_warn(_("block %d in %s ino %llu doesn't exist\n"), - da_bno, ftype, ino); + da_bno, ftype, ip->i_ino); return(NULLDFSBNO); } } @@ -1167,7 +1180,7 @@ if (!bp) { do_warn( _("can't read block %u (fsbno %llu) for directory inode %llu\n"), - da_bno, fsbno, ino); + da_bno, fsbno, ip->i_ino); return(NULLDFSBNO); } = @@ -1177,7 +1190,7 @@ libxfs_putbuf(bp); do_warn( _("bad dir/attr magic number in inode %llu, file bno =3D %u, fsbno =3D = %llu\n"), - ino, da_bno, fsbno); + ip->i_ino, da_bno, fsbno); return(NULLDFSBNO); } = @@ -1197,11 +1210,11 @@ if (!no_modify) do_error( _("can't map block %d in %s ino %llu, xfs_bmapi returns %d, nmap =3D %d= \n"), - da_bno, ftype, ino, error, nmap); + da_bno, ftype, ip->i_ino, error, nmap); else { do_warn( _("can't map block %d in %s ino %llu, xfs_bmapi returns %d, nmap =3D %d= \n"), - da_bno, ftype, ino, error, nmap); + da_bno, ftype, ip->i_ino, error, nmap); return(NULLDFSBNO); } } @@ -1209,11 +1222,11 @@ if (!no_modify) do_error( _("block %d in %s inode %llu doesn't exist\n"), - da_bno, ftype, ino); + da_bno, ftype, ip->i_ino); else { do_warn( _("block %d in %s inode %llu doesn't exist\n"), - da_bno, ftype, ino); + da_bno, ftype, ip->i_ino); return(NULLDFSBNO); } } @@ -1236,8 +1249,7 @@ * this routine can NOT be called if running in no modify mode */ static int -prune_lf_dir_entry(xfs_mount_t *mp, xfs_ino_t ino, xfs_inode_t *ip, - xfs_dahash_t *hashval) +prune_lf_dir_entry(xfs_mount_t *mp, xfs_inode_t *ip, xfs_dahash_t *hash= val) { xfs_dfsbno_t fsbno; int i; @@ -1280,7 +1292,7 @@ namest =3D NULL; fblock =3D NULLFSBLOCK; = - fsbno =3D map_first_dblock_fsbno(mp, ino, ip, &da_bno); + fsbno =3D map_first_dblock_fsbno(mp, ip, &da_bno); = /* * now go foward along the leaves of the btree looking @@ -1293,7 +1305,7 @@ if (!bp) { do_error( _("can't read directory inode %llu (leaf) block %u (fsbno %llu)\n"), - ino, da_bno, fsbno); + ip->i_ino, da_bno, fsbno); /* NOTREACHED */ } = @@ -1335,12 +1347,12 @@ if (error || nmap !=3D 1) do_error( _("can't map block %d in directory %llu, xfs_bmapi returns %d, nmap =3D= %d\n"), - da_bno, ino, error, nmap); + da_bno, ip->i_ino, error, nmap); if ((fsbno =3D map.br_startblock) =3D=3D HOLESTARTBLOCK) { do_error( _("%s ino %llu block %d doesn't exist\n"), - ftype, ino, da_bno); + ftype, ip->i_ino, da_bno); } } } @@ -1395,7 +1407,7 @@ if (error) { do_error( _("couldn't remove bogus entry \"%s\" in\n\tdirectory inode %llu, errno= =3D %d\n"), - fname, ino, error); + fname, ip->i_ino, error); /* NOTREACHED */ } = @@ -1432,7 +1444,7 @@ */ static void lf_block_dir_entry_check(xfs_mount_t *mp, - xfs_ino_t ino, + xfs_inode_t *ip, xfs_dir_leafblock_t *leaf, int *dirty, int *num_illegal, @@ -1516,7 +1528,7 @@ * '..' is already accounted for or will be taken care * of when directory is moved to orphanage. */ - if (ino =3D=3D lino) { + if (ip->i_ino =3D=3D lino) { ASSERT(namest->name[0] =3D=3D '.' && entry->namelen =3D=3D 1); add_inode_ref(current_irec, current_ino_offset); *need_dot =3D 0; @@ -1539,7 +1551,7 @@ nbad++; if (entry_junked(_("entry \"%s\" in dir inode %llu " "points to non-existent inode %llu"), - fname, ino, lino)) { + fname, ip->i_ino, lino)) { namest->name[0] =3D '/'; *dirty =3D 1; } @@ -1557,7 +1569,7 @@ nbad++; if (entry_junked(_("entry \"%s\" in dir inode %llu " "points to free inode %llu"), - fname, ino, lino)) { + fname, ip->i_ino, lino)) { namest->name[0] =3D '/'; *dirty =3D 1; } @@ -1566,14 +1578,15 @@ /* * check if this inode is lost+found dir in the root */ - if (ino =3D=3D mp->m_sb.sb_rootino && strcmp(fname, ORPHANAGE) =3D=3D= 0) { + if (ip->i_ino =3D=3D mp->m_sb.sb_rootino && + strcmp(fname, ORPHANAGE) =3D=3D 0) { /* root inode, "lost+found", if it's not a directory, * trash it, otherwise, assign it */ if (!inode_isadir(irec, ino_offset)) { nbad++; if (entry_junked(_("%s (ino %llu) in root " "(%llu) is not a directory"), - ORPHANAGE, lino, ino)) { + ORPHANAGE, lino, ip->i_ino)) { namest->name[0] =3D '/'; *dirty =3D 1; } @@ -1589,13 +1602,13 @@ /* * check for duplicate names in directory. */ - if (!dir_hash_add(hashtab, (da_bno << mp->m_sb.sb_blocklog) + - entry->nameidx, lino, entry->namelen, - namest->name)) { + if (!dir_hash_add(hashtab, ip, (da_bno << + mp->m_sb.sb_blocklog) + entry->nameidx, + lino, entry->namelen, namest->name)) { nbad++; if (entry_junked(_("entry \"%s\" (ino %llu) in dir " "%llu is a duplicate name"), - fname, lino, ino)) { + fname, lino, ip->i_ino)) { namest->name[0] =3D '/'; *dirty =3D 1; } @@ -1626,15 +1639,15 @@ junkit =3D 1; do_warn( _("entry \"%s\" in dir %llu points to an already connected dir inode %l= lu,\n"), - fname, ino, lino); - } else if (parent =3D=3D ino) { + fname, ip->i_ino, lino); + } else if (parent =3D=3D ip->i_ino) { add_inode_reached(irec, ino_offset); add_inode_ref(current_irec, current_ino_offset); } else { junkit =3D 1; do_warn( _("entry \"%s\" in dir ino %llu not consistent with .. value (%llu) in = ino %llu,\n"), - fname, ino, parent, lino); + fname, ip->i_ino, parent, lino); } = if (junkit) { @@ -1666,7 +1679,6 @@ */ static void longform_dir_entry_check(xfs_mount_t *mp, - xfs_ino_t ino, xfs_inode_t *ip, int *num_illegal, int *need_dot, @@ -1691,10 +1703,11 @@ *need_dot =3D 1; ftype =3D _("dir"); = - fsbno =3D map_first_dblock_fsbno(mp, ino, ip, &da_bno); + fsbno =3D map_first_dblock_fsbno(mp, ip, &da_bno); = if (fsbno =3D=3D NULLDFSBNO && no_modify) { - do_warn(_("cannot map block 0 of directory inode %llu\n"), ino); + do_warn(_("cannot map block 0 of directory inode %llu\n"), + ip->i_ino); return; } = @@ -1708,7 +1721,7 @@ if (!bp) { do_error( _("can't read block %u (fsbno %llu) for directory inode %llu\n"), - da_bno, fsbno, ino); + da_bno, fsbno, ip->i_ino); /* NOTREACHED */ } = @@ -1721,7 +1734,7 @@ _("bad magic # (0x%x) for dir ino %llu leaf block (bno %u fsbno %llu)\n= "), INT_GET(leaf->hdr.info.magic, ARCH_CONVERT), - ino, da_bno, fsbno); + ip->i_ino, da_bno, fsbno); /* NOTREACHED */ } else { /* @@ -1734,7 +1747,7 @@ } = if (!skipit) - lf_block_dir_entry_check(mp, ino, leaf, &dirty, + lf_block_dir_entry_check(mp, ip, leaf, &dirty, num_illegal, need_dot, irec, ino_offset, hashtab, da_bno); = @@ -1757,11 +1770,11 @@ if (!no_modify) do_error( _("can't map leaf block %d in dir %llu, xfs_bmapi returns %d, nmap =3D = %d\n"), - da_bno, ino, error, nmap); + da_bno, ip->i_ino, error, nmap); else { do_warn( _("can't map leaf block %d in dir %llu, xfs_bmapi returns %d, nmap =3D = %d\n"), - da_bno, ino, error, nmap); + da_bno, ip->i_ino, error, nmap); return; } } @@ -1769,11 +1782,11 @@ if (!no_modify) do_error( _("block %d in %s ino %llu doesn't exist\n"), - da_bno, ftype, ino); + da_bno, ftype, ip->i_ino); else { do_warn( _("block %d in %s ino %llu doesn't exist\n"), - da_bno, ftype, ino); + da_bno, ftype, ip->i_ino); return; } } @@ -1788,10 +1801,9 @@ = static void longform_dir2_rebuild( - xfs_mount_t *mp, - xfs_ino_t ino, - xfs_inode_t *ip, - dir_hash_tab_t *hashtab) + xfs_mount_t *mp, + xfs_inode_t *ip, + dir_hash_tab_t *hashtab) { int error; int nres; @@ -1810,7 +1822,7 @@ * name/inode pairs in the hash table */ = - do_warn(_("rebuilding directory inode %llu\n"), ino); + do_warn(_("rebuilding directory inode %llu\n"), ip->i_ino); = /* * first attempt to locate the parent inode, if it can't be found, @@ -1891,7 +1903,7 @@ nres))) { do_warn( _("name create failed in ino %llu (%d), filesystem may be out of space\= n"), - ino, error); + ip->i_ino, error); libxfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES | XFS_TRANS_ABORT); break; @@ -2253,9 +2265,24 @@ orphanage_ino =3D inum; } /* + * check for invalid UTF-8 name if Unicode filesystem + */ + if (xfs_sb_version_hasunicode(&mp->m_sb) && + xfs_unicode_validate((uchar_t *)dep->name, + dep->namelen) !=3D 0) { + nbad++; + if (entry_junked(_("entry \"%s\" (ino %llu) in dir " + "%llu is not a valid UTF-8 name"), + fname, inum, ip->i_ino)) { + dep->name[0] =3D '/'; + libxfs_dir2_data_log_entry(tp, bp, dep); + } + continue; + } + /* * check for duplicate names in directory. */ - if (!dir_hash_add(hashtab, addr, inum, dep->namelen, + if (!dir_hash_add(hashtab, ip, addr, inum, dep->namelen, dep->name)) { nbad++; if (entry_junked(_("entry \"%s\" (ino %llu) in dir " @@ -2565,7 +2592,6 @@ */ static void longform_dir2_entry_check(xfs_mount_t *mp, - xfs_ino_t ino, xfs_inode_t *ip, int *num_illegal, int *need_dot, @@ -2629,7 +2655,7 @@ XFS_DATA_FORK)) { do_warn(_( "can't read data block %u for directory inode %llu\n"), - da_bno, ino); + da_bno, ip->i_ino); *num_illegal +=3D 1; continue; /* try and read all "data" blocks */ } @@ -2637,7 +2663,7 @@ irec, ino_offset, &bplist[db], hashtab, &freetab, da_bno, isblock); } - fixit =3D (*num_illegal !=3D 0) || dir2_is_badino(ino); + fixit =3D (*num_illegal !=3D 0) || dir2_is_badino(ip->i_ino); = /* check btree and freespace */ if (isblock) { @@ -2659,7 +2685,7 @@ for (i =3D 0; i < freetab->naents; i++) if (bplist[i]) libxfs_da_brelse(NULL, bplist[i]); - longform_dir2_rebuild(mp, ino, ip, hashtab); + longform_dir2_rebuild(mp, ip, hashtab); *num_illegal =3D 0; } else { for (i =3D 0; i < freetab->naents; i++) @@ -2677,7 +2703,6 @@ */ static void shortform_dir_entry_check(xfs_mount_t *mp, - xfs_ino_t ino, xfs_inode_t *ip, int *ino_dirty, ino_tree_node_t *current_irec, @@ -2726,7 +2751,7 @@ if (sf =3D=3D NULL) { junkit =3D 1; do_warn(_("shortform dir inode %llu has null data entries \n"), - ino); + ip->i_ino); = } else { @@ -2794,7 +2819,7 @@ if (irec =3D=3D NULL) { do_warn(_("entry \"%s\" in shortform dir %llu " "references non-existent ino %llu"), - fname, ino, lino); + fname, ip->i_ino, lino); goto do_junkit; } ino_offset =3D XFS_INO_TO_AGINO(mp, lino) - irec->ino_startnum; @@ -2806,19 +2831,22 @@ */ if (!is_inode_free(irec, ino_offset)) { do_warn(_("entry \"%s\" in shortform dir inode %llu " - "points to free inode %llu"), fname, ino, lino); + "points to free inode %llu"), + fname, ip->i_ino, lino); goto do_junkit; } /* * check if this inode is lost+found dir in the root */ - if (ino =3D=3D mp->m_sb.sb_rootino && strcmp(fname, ORPHANAGE) =3D=3D= 0) { + if (ip->i_ino =3D=3D mp->m_sb.sb_rootino && + strcmp(fname, ORPHANAGE) =3D=3D 0) { /* * if it's not a directory, trash it */ if (!inode_isadir(irec, ino_offset)) { do_warn(_("%s (ino %llu) in root (%llu) is not " - "a directory"), ORPHANAGE, lino, ino); + "a directory"), + ORPHANAGE, lino, ip->i_ino); goto do_junkit; } /* @@ -2831,11 +2859,11 @@ /* * check for duplicate names in directory. */ - if (!dir_hash_add(hashtab, + if (!dir_hash_add(hashtab, ip, (xfs_dir2_dataptr_t)(sf_entry - &sf->list[0]), lino, sf_entry->namelen, sf_entry->name)) { do_warn(_("entry \"%s\" (ino %llu) in dir %llu is a " - "duplicate name"), fname, lino, ino); + "duplicate name"), fname, lino, ip->i_ino); goto do_junkit; } if (!inode_isadir(irec, ino_offset)) { @@ -2861,8 +2889,8 @@ junkit =3D 1; do_warn(_("entry \"%s\" in dir %llu references " "already connected dir ino %llu,\n"), - fname, ino, lino); - } else if (parent =3D=3D ino) { + fname, ip->i_ino, lino); + } else if (parent =3D=3D ip->i_ino) { add_inode_reached(irec, ino_offset); add_inode_ref(current_irec, current_ino_offset); } else { @@ -2870,7 +2898,7 @@ do_warn(_("entry \"%s\" in dir %llu not " "consistent with .. value (%llu) in " "dir ino %llu"), - fname, ino, parent, lino); + fname, ip->i_ino, parent, lino); } } if (junkit) { @@ -2960,7 +2988,7 @@ = /* ARGSUSED */ static void -prune_sf_dir_entry(xfs_mount_t *mp, xfs_ino_t ino, xfs_inode_t *ip) +prune_sf_dir_entry(xfs_mount_t *mp, xfs_inode_t *ip) { /* REFERENCED */ xfs_ino_t lino; @@ -3058,7 +3086,6 @@ */ static void shortform_dir2_entry_check(xfs_mount_t *mp, - xfs_ino_t ino, xfs_inode_t *ip, int *ino_dirty, ino_tree_node_t *current_irec, @@ -3188,7 +3215,7 @@ if (irec =3D=3D NULL) { do_warn(_("entry \"%s\" in shortform directory %llu " "references non-existent inode %llu"), - fname, ino, lino); + fname, ip->i_ino, lino); goto do_junkit; } = @@ -3202,19 +3229,21 @@ if (is_inode_free(irec, ino_offset)) { do_warn(_("entry \"%s\" in shortform directory " "inode %llu points to free inode %llu"), - fname, ino, lino); + fname, ip->i_ino, lino); goto do_junkit; } /* * check if this inode is lost+found dir in the root */ - if (ino =3D=3D mp->m_sb.sb_rootino && strcmp(fname, ORPHANAGE) =3D=3D= 0) { + if (ip->i_ino =3D=3D mp->m_sb.sb_rootino && + strcmp(fname, ORPHANAGE) =3D=3D 0) { /* * if it's not a directory, trash it */ if (!inode_isadir(irec, ino_offset)) { do_warn(_("%s (ino %llu) in root (%llu) is not " - "a directory"), ORPHANAGE, lino, ino); + "a directory"), + ORPHANAGE, lino, ip->i_ino); goto do_junkit; } /* @@ -3225,13 +3254,24 @@ orphanage_ino =3D lino; } /* + * check for invalid UTF-8 name if Unicode filesystem + */ + if (xfs_sb_version_hasunicode(&mp->m_sb) && + xfs_unicode_validate((uchar_t *)sfep->name, + sfep->namelen) !=3D 0) { + do_warn(_("entry \"%s\" (ino %llu) in dir %llu is " + "not a valid UTF-8 name"), + fname, lino, ip->i_ino); + goto do_junkit; + } + /* * check for duplicate names in directory. */ - if (!dir_hash_add(hashtab, (xfs_dir2_dataptr_t) + if (!dir_hash_add(hashtab, ip, (xfs_dir2_dataptr_t) (sfep - XFS_DIR2_SF_FIRSTENTRY(sfp)), lino, sfep->namelen, sfep->name)) { do_warn(_("entry \"%s\" (ino %llu) in dir %llu is a " - "duplicate name"), fname, lino, ino); + "duplicate name"), fname, lino, ip->i_ino); goto do_junkit; } if (!inode_isadir(irec, ino_offset)) { @@ -3252,17 +3292,17 @@ junkit =3D 1; do_warn(_("entry \"%s\" in directory inode %llu" " references already connected inode " - "%llu,\n"), - fname, ino, lino); - } else if (parent =3D=3D ino) { + "%llu"), + fname, ip->i_ino, lino); + } else if (parent =3D=3D ip->i_ino) { add_inode_reached(irec, ino_offset); add_inode_ref(current_irec, current_ino_offset); } else { junkit =3D 1; do_warn(_("entry \"%s\" in directory inode %llu" " not consistent with .. value (%llu)" - " in inode %llu,\n"), - fname, ino, parent, lino); + " in inode %llu"), + fname, ip->i_ino, parent, lino); } } = @@ -3302,11 +3342,11 @@ *ino_dirty =3D 1; = if (verbose) - do_warn(_("junking entry\n")); + do_warn(_(", junking entry\n")); else do_warn("\n"); } else { - do_warn(_("would junk entry\n")); + do_warn(_(", would junk entry\n")); } } else if (lino > XFS_DIR2_MAX_SHORT_INUM) i8++; @@ -3330,7 +3370,8 @@ = if (sfp->hdr.i8count !=3D i8) { if (no_modify) { - do_warn(_("would fix i8count in inode %llu\n"), ino); + do_warn(_("would fix i8count in inode %llu\n"), + ip->i_ino); } else { if (i8 =3D=3D 0) { tmp_sfep =3D next_sfep; @@ -3342,7 +3383,7 @@ } else sfp->hdr.i8count =3D i8; *ino_dirty =3D 1; - do_warn(_("fixing i8count in inode %llu\n"), ino); + do_warn(_("fixing i8count in inode %llu\n"), ip->i_ino); } } = @@ -3418,6 +3459,7 @@ add_inode_refchecked(ino, irec, 0); return; } + ASSERT(ip->i_ino =3D=3D ino); = need_dot =3D dirty =3D num_illegal =3D 0; = @@ -3450,15 +3492,13 @@ * we need to create '.' entries here. */ if (XFS_SB_VERSION_HASDIRV2(&mp->m_sb)) - longform_dir2_entry_check(mp, ino, ip, - &num_illegal, &need_dot, - irec, ino_offset, - hashtab); + longform_dir2_entry_check(mp, ip, &num_illegal, + &need_dot, irec, ino_offset, + hashtab); else - longform_dir_entry_check(mp, ino, ip, - &num_illegal, &need_dot, - irec, ino_offset, - hashtab); + longform_dir_entry_check(mp, ip, &num_illegal, + &need_dot, irec, ino_offset, + hashtab); break; = case XFS_DINODE_FMT_LOCAL: @@ -3481,13 +3521,11 @@ libxfs_trans_ihold(tp, ip); = if (XFS_SB_VERSION_HASDIRV2(&mp->m_sb)) - shortform_dir2_entry_check(mp, ino, ip, &dirty, - irec, ino_offset, - hashtab); + shortform_dir2_entry_check(mp, ip, &dirty, + irec, ino_offset, hashtab); else - shortform_dir_entry_check(mp, ino, ip, &dirty, - irec, ino_offset, - hashtab); + shortform_dir_entry_check(mp, ip, &dirty, + irec, ino_offset, hashtab); = ASSERT(dirty =3D=3D 0 || (dirty && !no_modify)); if (dirty) { @@ -3567,7 +3605,7 @@ = while (num_illegal > 0 && ip->i_d.di_format !=3D XFS_DINODE_FMT_LOCAL) { - prune_lf_dir_entry(mp, ino, ip, &hashval); + prune_lf_dir_entry(mp, ip, &hashval); num_illegal--; } = @@ -3600,7 +3638,7 @@ libxfs_trans_ijoin(tp, ip, 0); libxfs_trans_ihold(tp, ip); = - prune_sf_dir_entry(mp, ino, ip); + prune_sf_dir_entry(mp, ip); = libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE | XFS_ILOG_DDATA); @@ -3679,7 +3717,7 @@ = /* * mark realtime bitmap and summary inodes as reached. - * quota inode will be marked here as well + * quota and casefold table inodes will be marked here as well */ void mark_standalone_inodes(xfs_mount_t *mp) @@ -3707,6 +3745,15 @@ = add_inode_reached(irec, offset); = + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + irec =3D find_inode_rec(XFS_INO_TO_AGNO(mp, mp->m_sb.sb_cftino), + XFS_INO_TO_AGINO(mp, mp->m_sb.sb_cftino)); + offset =3D XFS_INO_TO_AGINO(mp, mp->m_sb.sb_cftino) - + irec->ino_startnum; + ASSERT(irec !=3D NULL); + add_inode_reached(irec, offset); + } + if (fs_quotas) { if (mp->m_sb.sb_uquotino && mp->m_sb.sb_uquotino !=3D NULLFSINO) { @@ -3882,6 +3929,15 @@ } } = + if (xfs_sb_version_hasunicode(&mp->m_sb) && (mp->m_sb.sb_cftino =3D=3D= 0 || + mp->m_sb.sb_cftino =3D=3D NULLFSINO)) { + if (!no_modify) { + do_warn(_("reinitializing casefold table inode\n")); + mk_cftino(mp); + } else + do_warn(_("would reinitializing casefold table inode\n")); + } + if (!no_modify) { do_log( _(" - resetting contents of realtime bitmap and summary inodes\n= ")); @@ -3896,6 +3952,11 @@ } } = + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + if (xfs_unicode_read_cft(mp) !=3D 0) + do_error(_("cannot read case folding table\n")); + } + mark_standalone_inodes(mp); = do_log(_(" - traversing filesystem ...\n")); Index: ci/xfsprogs/db/check.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/db/check.c 2008-01-18 14:50:42.000000000 +1100 +++ ci/xfsprogs/db/check.c 2008-01-18 15:00:09.076565357 +1100 @@ -31,6 +31,7 @@ #include "output.h" #include "init.h" #include "malloc.h" +#include "casefoldtable.h" = typedef enum { IS_USER_QUOTA, IS_PROJECT_QUOTA, IS_GROUP_QUOTA, @@ -39,11 +40,11 @@ typedef enum { DBM_UNKNOWN, DBM_AGF, DBM_AGFL, DBM_AGI, DBM_ATTR, DBM_BTBMAPA, DBM_BTBMAPD, DBM_BTBNO, - DBM_BTCNT, DBM_BTINO, DBM_DATA, DBM_DIR, - DBM_FREE1, DBM_FREE2, DBM_FREELIST, DBM_INODE, - DBM_LOG, DBM_MISSING, DBM_QUOTA, DBM_RTBITMAP, - DBM_RTDATA, DBM_RTFREE, DBM_RTSUM, DBM_SB, - DBM_SYMLINK, + DBM_BTCNT, DBM_BTINO, DBM_CFT, DBM_DATA, + DBM_DIR, DBM_FREE1, DBM_FREE2, DBM_FREELIST, + DBM_INODE, DBM_LOG, DBM_MISSING, DBM_QUOTA, + DBM_RTBITMAP, DBM_RTDATA, DBM_RTFREE, DBM_RTSUM, + DBM_SB, DBM_SYMLINK, DBM_NDBM } dbm_t; = @@ -153,6 +154,7 @@ "btbno", "btcnt", "btino", + "cft", "data", "dir", "free1", @@ -224,6 +226,7 @@ static int blocktrash_f(int argc, char **argv); static int blockuse_f(int argc, char **argv); static int check_blist(xfs_fsblock_t bno); +static void check_cft(void); static void check_dbmap(xfs_agnumber_t agno, xfs_agblock_t agbno, xfs_extlen_t len, dbm_t type); static int check_inomap(xfs_agnumber_t agno, xfs_agblock_t agbno, @@ -249,7 +252,7 @@ xfs_extlen_t len, int typemask); static void checknot_rdbmap(xfs_drfsbno_t bno, xfs_extlen_t len, int typemask); -static void dir_hash_add(xfs_dahash_t hash, +static void dir_hash_add(const uchar_t *name, int namelen, xfs_dir2_dataptr_t addr); static void dir_hash_check(inodata_t *id, int v); static void dir_hash_done(void); @@ -1227,6 +1230,170 @@ } = static void +check_cft(void) +{ + xfs_agblock_t agbno; + xfs_agino_t agino; + xfs_dinode_t *dip; + xfs_dinode_core_t tdic; + xfs_extnum_t nextents =3D 0; + xfs_drfsbno_t totdblocks =3D 0; + xfs_drfsbno_t totiblocks =3D 0; + blkmap_t *blkmap; + xfs_dcft_t *cfthdr; + int off; + int i; + xfs_dfsbno_t fsbno; + int ntables; + int lower_off; + + /* + * Without CRCs, cannot verify the actual table, just the header + * consistency. + */ + cfthdr =3D NULL; + agino =3D XFS_INO_TO_AGINO(mp, mp->m_sb.sb_cftino); + agbno =3D XFS_AGINO_TO_AGBNO(mp, agino); + off =3D XFS_AGINO_TO_OFFSET(mp, agino); + if (XFS_INO_TO_AGNO(mp, mp->m_sb.sb_cftino) !=3D 0 || + agbno >=3D mp->m_sb.sb_agblocks || + off >=3D mp->m_sb.sb_inopblock) { + if (!sflag) + dbprintf("bad casefold table inode number %lld\n", + mp->m_sb.sb_cftino); + goto bad_out; + } + set_cur(&typtab[TYP_INODE], XFS_AGB_TO_DADDR(mp, 0, agbno), + blkbb, DB_RING_IGN, NULL); + off_cur(off << mp->m_sb.sb_inodelog, mp->m_sb.sb_inodesize); + dip =3D iocur_top->data; + + libxfs_xlate_dinode_core((xfs_caddr_t)&dip->di_core, &tdic, 1); + memcpy(&dip->di_core, &tdic, sizeof(xfs_dinode_core_t)); + + /* do some basic inode checks */ + if ((dip->di_core.di_mode & S_IFMT) !=3D S_IFREG) { + if (!sflag) + dbprintf("casefold table inode mode invalid\n"); + goto bad_out; + } + if (dip->di_core.di_format !=3D XFS_DINODE_FMT_EXTENTS) { + dbprintf("casefold table inode format invalid\n"); + goto bad_out; + } + if (dip->di_core.di_size <=3D sizeof(xfs_dcft_t) + sizeof(__be32) * + XFS_CFT_MAX_NUM_TABLES) { + if (!sflag) + dbprintf("casefold table inode size too small\n"); + return; + } + blkmap =3D blkmap_alloc(dip->di_core.di_nextents); + + process_exinode(find_inode(mp->m_sb.sb_cftino, 1), dip, DBM_CFT, + &totdblocks, &totiblocks, &nextents, &blkmap, + XFS_DATA_FORK); + ASSERT(totiblocks =3D=3D 0); + if (totdblocks !=3D dip->di_core.di_nblocks) { + if (!sflag) + dbprintf("bad nblocks %lld for casefold table inode " + "%lld, counted %lld\n", dip->di_core.di_nblocks, + mp->m_sb.sb_cftino, totdblocks); + goto bad_out; + } + if (nextents !=3D dip->di_core.di_nextents) { + if (!sflag) + dbprintf("bad nextents %d for casefold table inode " + "%lld, counted %d\n", dip->di_core.di_nextents, + mp->m_sb.sb_cftino, nextents); + goto bad_out; + } + + cfthdr =3D xmalloc(sizeof(xfs_dcft_t) + sizeof(__be32) * + XFS_CFT_MAX_NUM_TABLES); + + /* make sure we can read the entire table, should not be sparse */ + for (i =3D 0; i < totdblocks; i++) { + fsbno =3D blkmap_get(blkmap, i); + if (fsbno =3D=3D NULLFSBLOCK) { + if (!sflag) + dbprintf("block %lld for casefold table inode " + "is missing\n", (xfs_dfiloff_t)i); + goto bad_out; + } + push_cur(); + set_cur(&typtab[TYP_CFT], XFS_FSB_TO_DADDR(mp, fsbno), blkbb, + DB_RING_IGN, NULL); + if (iocur_top->data =3D=3D NULL) { + pop_cur(); + if (!sflag) + dbprintf("can't read block %lld for casfold " + "table inode\n", (xfs_dfiloff_t)i); + goto bad_out; + } + if (i =3D=3D 0) + memcpy(cfthdr, iocur_top->data, sizeof(xfs_dcft_t) + + sizeof(__be32) * XFS_CFT_MAX_NUM_TABLES); + pop_cur(); + } + + /* verify contents of the header */ + if (be32_to_cpu(cfthdr->cft_magic) !=3D XFS_CFT_MAGIC) { + if (!sflag) + dbprintf("bad magic number 0x%x in casefold table (ino %llu)\n", + be32_to_cpu(cfthdr->cft_magic), mp->m_sb.sb_cftino); + goto bad_out; + } + if (be32_to_cpu(cfthdr->cft_flags) > XFS_CFT_FLAG_MAX) { + if (!sflag) + dbprintf("invalid flags (0x%x) in casefold table (ino %llu)\n", + be32_to_cpu(cfthdr->cft_flags), mp->m_sb.sb_cftino); + goto bad_out; + } + if (platform_uuid_compare(&cfthdr->cft_uuid, &mp->m_sb.sb_uuid) !=3D 0= ) { + if (!sflag) + dbprintf("mismatched UUID in casefold table (ino %llu)\n", + mp->m_sb.sb_cftino); + goto bad_out; + } + ntables =3D be32_to_cpu(cfthdr->cft_num_tables); + if (ntables < XFS_CFT_MIN_NUM_TABLES || + ntables > XFS_CFT_MAX_NUM_TABLES) { + if (!sflag) + dbprintf("invalid number of tables (%d) in casefold " + "table (ino %llu)\n", ntables, mp->m_sb.sb_cftino); + goto bad_out; + } + lower_off =3D sizeof(xfs_dcft_t) + sizeof(__be32) * (ntables - 1); + for (i =3D 0; i < ntables; i++) { + off =3D be32_to_cpu(cfthdr->cft_table_offset[i]); + if (off < lower_off || off > dip->di_core.di_size) { + if (!sflag) + dbprintf("invalid table offset (%d) in " + "casefold table (ino %llu)\n", + off, mp->m_sb.sb_cftino); + goto bad_out; + } + lower_off =3D off + sizeof(__be16); + } + if (xfs_unicode_read_cft(mp) =3D=3D 0) { + xfree(cfthdr); + if (blkmap) + blkmap_free(blkmap); + return; + } + +bad_out: + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + mp->m_dirnameops =3D &xfs_default_nameops; + mp->m_attrnameops =3D &xfs_default_nameops; + } + error++; + xfree(cfthdr); + if (blkmap) + blkmap_free(blkmap); +} + +static void check_dbmap( xfs_agnumber_t agno, xfs_agblock_t agbno, @@ -1605,12 +1772,19 @@ = static void dir_hash_add( - xfs_dahash_t hash, + const uchar_t *name, + int namelen, xfs_dir2_dataptr_t addr) { + xfs_inode_t inode; + xfs_dahash_t hash; int i; dirhash_t *p; = + /* xfs_dir_hashname only uses i_mount in xfs_inode_t for now */ + inode.i_mount =3D mp; + hash =3D xfs_dir_hashname(&inode, name, namelen); + i =3D DIR_HASH_FUNC(hash, addr); p =3D malloc(sizeof(*p)); p->next =3D dirhash[i]; @@ -1778,6 +1952,18 @@ sumfile =3D xcalloc(mp->m_rsumsize, 1); sumcompute =3D xcalloc(mp->m_rsumsize, 1); } + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + if (mp->m_sb.sb_cftino =3D=3D 0 || mp->m_sb.sb_cftino =3D=3D NULLFSIN= O) + dbprintf("missing casefold table inode number for " + "unicode filesystem\n"); + else + check_cft(); /* need CFT before processing root dir */ + } else { + if (mp->m_sb.sb_cftino !=3D 0 && mp->m_sb.sb_cftino !=3D NULLFSINO) + dbprintf("bad casefold table inode number %llu for " + "non-unicode filesystem\n", mp->m_sb.sb_cftino); + } + nflag =3D sflag =3D tflag =3D verbose =3D optind =3D 0; while ((c =3D getopt(argc, argv, "b:i:npstv")) !=3D EOF) { switch (c) { @@ -2188,7 +2374,6 @@ char *endptr; int freeseen; freetab_t *freetab; - xfs_dahash_t hash; int i; int lastfree; int lastfree_err; @@ -2308,8 +2493,18 @@ tag_err +=3D INT_GET(*tagp, ARCH_CONVERT) !=3D (char *)dep - (char *)= data; addr =3D XFS_DIR2_DB_OFF_TO_DATAPTR(mp, db, (char *)dep - (char *)data); - hash =3D libxfs_da_hashname((uchar_t *)dep->name, dep->namelen); - dir_hash_add(hash, addr); + if (xfs_sb_version_hasunicode(&mp->m_sb) && + xfs_unicode_validate((uchar_t *)dep->name, + dep->namelen) !=3D 0) { + if (!sflag) + dbprintf("dir %lld block %d invalid UTF-8 " + "name in entry at %d\n", + id->ino, dabno, + (int)((char *)dep - (char *)data)); + error++; + break; + } + dir_hash_add((uchar_t *)dep->name, dep->namelen, addr); ptr +=3D XFS_DIR2_DATA_ENTSIZE(dep->namelen); count++; lastfree =3D 0; @@ -2744,6 +2939,10 @@ type =3D DBM_RTSUM; blkmap =3D blkmap_alloc(dic->di_nextents); addlink_inode(id); + } else if (id->ino =3D=3D mp->m_sb.sb_cftino) { + type =3D DBM_CFT; + blkmap =3D blkmap_alloc(dic->di_nextents); + addlink_inode(id); } else if (id->ino =3D=3D mp->m_sb.sb_uquotino || id->ino =3D=3D mp->m_sb.sb_gquotino) { @@ -2776,8 +2975,9 @@ &nextents, &blkmap, XFS_DATA_FORK); break; case XFS_DINODE_FMT_EXTENTS: - process_exinode(id, dip, type, &totdblocks, &totiblocks, - &nextents, &blkmap, XFS_DATA_FORK); + if (type !=3D DBM_CFT) + process_exinode(id, dip, type, &totdblocks, &totiblocks, + &nextents, &blkmap, XFS_DATA_FORK); break; case XFS_DINODE_FMT_BTREE: process_btinode(id, dip, type, &totdblocks, &totiblocks, @@ -2801,6 +3001,8 @@ break; } } + if (type =3D=3D DBM_CFT) + return; /* already checked enough in check_cft from init */ if (qgdo || qpdo || qudo) { switch (type) { case DBM_DATA: @@ -2854,6 +3056,7 @@ process_rtbitmap(blkmap); else if (type =3D=3D DBM_RTSUM) process_rtsummary(blkmap); + /* * If the CHKD flag is not set, this can legitimately contain garbage;= * xfs_repair may have cleared that bit. @@ -3634,6 +3837,15 @@ lino =3D XFS_DIR2_SF_GET_INUMBER(sf, XFS_DIR2_SF_INUMBERP(sfe)); if (lino > XFS_DIR2_MAX_SHORT_INUM) i8++; + if (xfs_sb_version_hasunicode(&mp->m_sb) && + xfs_unicode_validate((uchar_t *)sfe->name, + sfe->namelen) !=3D 0) { + if (!sflag) + dbprintf("dir %lld invalid UTF-8 name in " + "entry at offset %d\n", + id->ino, XFS_DIR2_SF_GET_OFFSET(sfe)); + error++; + } cid =3D find_inode(lino, 1); if (cid =3D=3D NULL) { if (!sflag) Index: ci/xfsprogs/repair/dino_chunks.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/repair/dino_chunks.c 2008-01-18 14:50:42.000000000 = +1100 +++ ci/xfsprogs/repair/dino_chunks.c 2008-01-18 15:00:09.080564844 +1100= @@ -885,6 +885,21 @@ XFS_AGINO_TO_INO(mp, agno, agino)); } + } else if (mp->m_sb.sb_cftino =3D=3D + XFS_AGINO_TO_INO(mp, agno, agino)) { + mp->m_sb.sb_cftino =3D 0; + + if (!no_modify) { + do_warn(_("cleared case fold table " + "inode %llu\n"), + XFS_AGINO_TO_INO(mp, agno, + agino)); + } else { + do_warn(_("would clear case fold table" + " inode %llu\n"), + XFS_AGINO_TO_INO(mp, agno, + agino)); + } } else if (!no_modify) { do_warn(_("cleared inode %llu\n"), XFS_AGINO_TO_INO(mp, agno, agino)); Index: ci/xfsprogs/repair/phase2.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/repair/phase2.c 2008-01-18 14:50:42.000000000 +1100= +++ ci/xfsprogs/repair/phase2.c 2008-01-18 15:00:09.080564844 +1100 @@ -168,8 +168,15 @@ (xfs_agino_t) mp->m_sb.sb_rootino); set_inode_used(ino_rec, 1); set_inode_used(ino_rec, 2); + j =3D 3; + /* if using unicode filenames, mark the next inode too */ + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + ASSERT(mp->m_sb.sb_cftino =3D=3D mp->m_sb.sb_rootino + 3); + set_inode_used(ino_rec, 3); + j++; + } = - for (j =3D 3; j < XFS_INODES_PER_CHUNK; j++) + for (; j < XFS_INODES_PER_CHUNK; j++) set_inode_free(ino_rec, j); = /* @@ -212,5 +219,15 @@ else do_warn(_("would correct\n")); } + + if (xfs_sb_version_hasunicode(&mp->m_sb) && + is_inode_free(ino_rec, 3)) { + do_warn(_("casefold table inode marked free, ")); + set_inode_used(ino_rec, 3); + if (!no_modify) + do_warn(_("correcting\n")); + else + do_warn(_("would correct\n")); + } } } Index: ci/xfsprogs/repair/xfs_repair.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/repair/xfs_repair.c 2008-01-18 14:50:42.000000000 += 1100 +++ ci/xfsprogs/repair/xfs_repair.c 2008-01-18 15:00:09.084564331 +1100 @@ -451,6 +451,26 @@ mp->m_sb.sb_rsumino =3D first_prealloc_ino + 2; } = + if (xfs_sb_version_hasunicode(&mp->m_sb) && + mp->m_sb.sb_cftino !=3D first_prealloc_ino + 3) { + do_warn(_("sb casefold table inode %llu %sinconsistent with " + "calculated value %lu\n"), mp->m_sb.sb_cftino, + (mp->m_sb.sb_cftino =3D=3D NULLFSINO ? "(NULLFSINO) ":""), + first_prealloc_ino + 3); + + if (!no_modify) + do_warn(_("resetting superblock casefold table ino " + "pointer to %lu\n"), first_prealloc_ino + 3); + else + do_warn(_("would reset superblock realtime summary ino " + "pointer to %lu\n"), first_prealloc_ino + 3); + + /* + * just set the value -- safe since the superblock + * doesn't get flushed out if no_modify is set + */ + mp->m_sb.sb_cftino =3D first_prealloc_ino + 3; + } } = int Index: ci/xfsprogs/repair/dinode.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/repair/dinode.c 2008-01-18 14:57:36.000000000 +1100= +++ ci/xfsprogs/repair/dinode.c 2008-01-18 15:00:09.088563817 +1100 @@ -17,6 +17,7 @@ */ = #include +#include #include "avl.h" #include "globals.h" #include "agheader.h" @@ -1670,6 +1671,100 @@ } = /* + * make sure the header of the case folding table is valid + */ +static int +process_cft( + xfs_mount_t *mp, + xfs_ino_t lino, + xfs_dinode_t *dino, + blkmap_t *blkmap) +{ + int rval =3D 1; + xfs_dcft_t *cft; + int size; + int off; + int i; + xfs_dfsbno_t fsbno; + xfs_buf_t *bp; + int ntables; + int lower_off; + + /* + * Already confirmed it's in extents, read all the blocks and + * verify the header. Without CRCs, cannot verify the actual + * table. If we find anything invalid, just junk it now and + * it will be rebuilt later in Phase 6. + */ + + cft =3D malloc(sizeof(xfs_dcft_t) + sizeof(__be32) * + XFS_CFT_MAX_NUM_TABLES); + if (!cft) + do_error(_("cannot allocate memory for CFT header\n")); + + /* make sure we can read the entire table */ + size =3D (int)be64_to_cpu(dino->di_core.di_size); + off =3D i =3D 0; + while (off < size) { + fsbno =3D blkmap_get(blkmap, i); + if (fsbno !=3D NULLDFSBNO) + bp =3D libxfs_readbuf(mp->m_dev, + XFS_FSB_TO_DADDR(mp, fsbno), + XFS_FSB_TO_BB(mp, 1), 0); + if (!bp || fsbno =3D=3D NULLDFSBNO) { + do_warn(_("cannot read casefold table inode %llu, " + "disk block %llu\n"), lino, fsbno); + goto bad_out; + } + if (i =3D=3D 0) + memcpy(cft, XFS_BUF_PTR(bp), sizeof(xfs_dcft_t) + + sizeof(__be32) * XFS_CFT_MAX_NUM_TABLES); + off +=3D XFS_BUF_SIZE(bp); + libxfs_putbuf(bp); + libxfs_purgebuf(bp); + i++; + } + + /* verify contents of the header */ + if (be32_to_cpu(cft->cft_magic) !=3D XFS_CFT_MAGIC) { + do_warn(_("bad magic number 0x%x in casefold table (ino %llu)\n"), + be32_to_cpu(cft->cft_magic), lino); + goto bad_out; + } + if (be32_to_cpu(cft->cft_flags) > XFS_CFT_FLAG_MAX) { + do_warn(_("invalid flags (0x%x) in casefold table (ino %llu)\n"), + be32_to_cpu(cft->cft_flags), lino); + goto bad_out; + } + if (platform_uuid_compare(&cft->cft_uuid, &mp->m_sb.sb_uuid) !=3D 0) {= + do_warn(_("mismatched UUID in casefold table (ino %llu)\n"), + lino); + goto bad_out; + } + ntables =3D be32_to_cpu(cft->cft_num_tables); + if (ntables < XFS_CFT_MIN_NUM_TABLES || + ntables > XFS_CFT_MAX_NUM_TABLES) { + do_warn(_("invalid number of tables (%d) in casefold table " + "(ino %llu)\n"), ntables, lino); + goto bad_out; + } + lower_off =3D sizeof(xfs_dcft_t) + sizeof(__be32) * (ntables - 1); + for (i =3D 0; i < ntables; i++) { + off =3D be32_to_cpu(cft->cft_table_offset[i]); + if (off < lower_off || off > size) { + do_warn(_("invalid table offset (%d) in casefold table " + "(ino %llu)\n"), off, lino); + goto bad_out; + } + lower_off =3D off + sizeof(__be16); + } + rval =3D 0; +bad_out: + free(cft); + return rval; +} + +/* * called to process the set of misc inode special inode types * that have no associated data storage (fifos, pipes, devices, etc.). */ @@ -1903,6 +1998,16 @@ } return 0; } + if (lino =3D=3D mp->m_sb.sb_cftino) { + if (*type !=3D XR_INO_DATA) { + do_warn(_("casefold table inode %llu has bad type 0x%x\n"), + lino, dinode_fmt(dinoc)); + mp->m_sb.sb_cftino =3D NULLFSINO; + return 1; + } + *type =3D XR_INO_CFT; + return 0; + } return 0; } = @@ -2770,6 +2875,13 @@ goto clear_bad_out; } break; + case XR_INO_CFT: + if (process_cft(mp, lino, dino, dblkmap) !=3D 0) { + do_warn(_("problem with casefold table in inode %llu\n"), + lino); + goto clear_bad_out; + } + break; default: break; } Index: ci/xfsprogs/db/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/db/Makefile 2008-01-18 14:50:42.000000000 +1100 +++ ci/xfsprogs/db/Makefile 2008-01-18 15:00:09.088563817 +1100 @@ -8,7 +8,7 @@ LTCOMMAND =3D xfs_db = HFILES =3D addr.h agf.h agfl.h agi.h attr.h attrshort.h bit.h block.h b= map.h \ - bmapbt.h bmroot.h bnobt.h check.h cntbt.h command.h convert.h \ + bmapbt.h bmroot.h bnobt.h cft.h check.h cntbt.h command.h convert.h \ dbread.h debug.h dir.h dir2.h dir2sf.h dirshort.h dquot.h echo.h \ faddr.h field.h flist.h fprint.h frag.h freesp.h hash.h help.h \ init.h inobt.h inode.h input.h io.h malloc.h metadump.h output.h \ Index: ci/xfsprogs/db/command.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/db/command.c 2008-01-18 14:50:42.000000000 +1100 +++ ci/xfsprogs/db/command.c 2008-01-18 15:00:09.088563817 +1100 @@ -33,6 +33,7 @@ #include "agf.h" #include "agfl.h" #include "agi.h" +#include "cft.h" #include "frag.h" #include "freesp.h" #include "help.h" @@ -121,6 +122,7 @@ attrset_init(); block_init(); bmap_init(); + cft_init(); check_init(); convert_init(); debug_init(); Index: ci/xfsprogs/db/field.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/db/field.c 2008-01-18 14:50:42.000000000 +1100 +++ ci/xfsprogs/db/field.c 2008-01-18 15:00:09.092563304 +1100 @@ -39,6 +39,7 @@ #include "dquot.h" #include "dir2.h" #include "dir2sf.h" +#include "cft.h" = const ftattr_t ftattrtab[] =3D { { FLDT_AEXTNUM, "aextnum", fp_num, "%d", SI(bitsz(xfs_aextnum_t)), @@ -133,6 +134,8 @@ 0, fa_cfileoffd, NULL }, { FLDT_CFSBLOCK, "cfsblock", fp_num, "%llu", SI(BMBT_STARTBLOCK_BITLEN= ), 0, fa_cfsblock, NULL }, + { FLDT_CFT, "cft", NULL, (char *)cft_flds, cft_size, FTARG_SIZE, NULL,= + cft_flds }, { FLDT_CHARNS, "charns", fp_charns, NULL, SI(bitsz(char)), 0, NULL, NULL }, { FLDT_CHARS, "chars", fp_num, "%c", SI(bitsz(char)), 0, NULL, NULL },= Index: ci/xfsprogs/db/field.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/db/field.h 2008-01-18 14:50:42.000000000 +1100 +++ ci/xfsprogs/db/field.h 2008-01-18 15:00:09.092563304 +1100 @@ -61,6 +61,7 @@ FLDT_CFILEOFFA, FLDT_CFILEOFFD, FLDT_CFSBLOCK, + FLDT_CFT, FLDT_CHARNS, FLDT_CHARS, FLDT_CNTBT, Index: ci/xfsprogs/db/inode.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/db/inode.c 2008-01-18 14:50:42.000000000 +1100 +++ ci/xfsprogs/db/inode.c 2008-01-18 15:00:09.092563304 +1100 @@ -410,6 +410,8 @@ else if (iocur_top->ino =3D=3D mp->m_sb.sb_uquotino || iocur_top->ino =3D=3D mp->m_sb.sb_gquotino) return TYP_DQBLK; + else if (iocur_top->ino =3D=3D mp->m_sb.sb_cftino) + return TYP_CFT; else return TYP_DATA; default: Index: ci/xfsprogs/db/metadump.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/db/metadump.c 2008-01-18 14:50:42.000000000 +1100 +++ ci/xfsprogs/db/metadump.c 2008-01-18 15:00:09.096562791 +1100 @@ -1537,6 +1537,9 @@ if (!copy_ino(mp->m_sb.sb_rsumino, TYP_RTSUMMARY)) return 0; = + if (!copy_ino(mp->m_sb.sb_cftino, TYP_CFT)) + return 0; + if (!copy_ino(mp->m_sb.sb_uquotino, TYP_DQBLK)) return 0; = Index: ci/xfsprogs/db/sb.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/db/sb.c 2008-01-18 14:50:42.000000000 +1100 +++ ci/xfsprogs/db/sb.c 2008-01-18 15:00:09.096562791 +1100 @@ -108,6 +108,7 @@ { "logsectsize", FLDT_UINT16D, OI(OFF(logsectsize)), C1, 0, TYP_NONE }= , { "logsunit", FLDT_UINT32D, OI(OFF(logsunit)), C1, 0, TYP_NONE }, { "features2", FLDT_UINT32X, OI(OFF(features2)), C1, 0, TYP_NONE }, + { "cftino", FLDT_INO, OI(OFF(cftino)), C1, 0, TYP_INODE }, { NULL } }; = @@ -604,12 +605,16 @@ strcat(s, ",EXTFLG"); if (XFS_SB_VERSION_HASSECTOR(sbp)) strcat(s, ",SECTOR"); + if (xfs_sb_version_hasoldci(sbp)) + strcat(s, ",OLDCI"); if (XFS_SB_VERSION_HASMOREBITS(sbp)) strcat(s, ",MOREBITS"); if (XFS_SB_VERSION_HASATTR2(sbp)) strcat(s, ",ATTR2"); if (XFS_SB_VERSION_LAZYSBCOUNT(sbp)) strcat(s, ",LAZYSBCOUNT"); + if (xfs_sb_version_hasunicode(sbp)) + strcat(s, ",UNICODE"); return s; } = Index: ci/xfsprogs/db/type.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/db/type.c 2008-01-18 14:50:42.000000000 +1100 +++ ci/xfsprogs/db/type.c 2008-01-18 15:00:09.096562791 +1100 @@ -43,6 +43,7 @@ #include "dquot.h" #include "dir2.h" #include "text.h" +#include "cft.h" = static const typ_t *findtyp(char *name); static int type_f(int argc, char **argv); @@ -61,6 +62,7 @@ { TYP_BMAPBTA, "bmapbta", handle_struct, bmapbta_hfld }, { TYP_BMAPBTD, "bmapbtd", handle_struct, bmapbtd_hfld }, { TYP_BNOBT, "bnobt", handle_struct, bnobt_hfld }, + { TYP_CFT, "cft", handle_struct, cft_hfld }, { TYP_CNTBT, "cntbt", handle_struct, cntbt_hfld }, { TYP_DATA, "data", handle_block, NULL }, { TYP_DIR, "dir", handle_struct, dir_hfld }, Index: ci/xfsprogs/db/type.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/db/type.h 2008-01-18 14:50:42.000000000 +1100 +++ ci/xfsprogs/db/type.h 2008-01-18 15:00:09.096562791 +1100 @@ -24,7 +24,7 @@ typedef enum typnm { TYP_AGF, TYP_AGFL, TYP_AGI, TYP_ATTR, TYP_BMAPBTA, - TYP_BMAPBTD, TYP_BNOBT, TYP_CNTBT, TYP_DATA, TYP_DIR, + TYP_BMAPBTD, TYP_BNOBT, TYP_CFT, TYP_CNTBT, TYP_DATA, TYP_DIR, TYP_DIR2, TYP_DQBLK, TYP_INOBT, TYP_INODATA, TYP_INODE, TYP_LOG, TYP_RTBITMAP, TYP_RTSUMMARY, TYP_SB, TYP_SYMLINK, TYP_TEXT, TYP_NONE Index: ci/xfsprogs/include/libxfs.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/include/libxfs.h 2008-01-18 14:50:42.000000000 +110= 0 +++ ci/xfsprogs/include/libxfs.h 2008-01-18 15:00:09.112560739 +1100 @@ -22,7 +22,7 @@ #define XFS_BIG_BLKNOS 1 = #include - +#include #include #include #include @@ -50,6 +50,7 @@ #include #include #include +#include = = #ifndef XFS_SUPER_MAGIC @@ -175,6 +176,9 @@ int m_attr_magicpct;/* 37% of the blocksize */ int m_dir_magicpct; /* 37% of the dir blocksize */ __uint8_t m_dirversion; /* 1 or 2 */ + const struct xfs_nameops *m_dirnameops; /* vector of dir name ops */ + const struct xfs_nameops *m_attrnameops;/* vector of attr name ops */ + const struct xfs_cft *m_cft; /* unicode case fold table */ int m_dirblksize; /* directory block sz--bytes */ int m_dirblkfsbs; /* directory block sz--fsbs */ xfs_dablk_t m_dirdatablk; /* blockno of dir data v2 */ @@ -401,7 +405,6 @@ extern void libxfs_free (void *); extern void *libxfs_realloc (void *, size_t); = - /* * Inode interface */ @@ -525,6 +528,10 @@ * All other routines we want to keep common... */ = +extern const struct xfs_nameops xfs_default_nameops; +extern const struct xfs_nameops xfs_unicode_nameops; +extern const struct xfs_nameops xfs_unicode_ci_nameops; + extern int libxfs_highbit32 (__uint32_t); extern int libxfs_highbit64 (__uint64_t); extern uint libxfs_da_log2_roundup (uint); @@ -556,6 +563,7 @@ xfs_extlen_t); = /* Directory/Attribute routines used by xfs_repair */ +extern void libxfs_attr_mount(xfs_mount_t *); extern void libxfs_da_bjoin (xfs_trans_t *, xfs_dabuf_t *); extern int libxfs_da_shrink_inode (xfs_da_args_t *, xfs_dablk_t, xfs_dabuf_t *); Index: ci/xfsprogs/include/xfs_attr_leaf.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/include/xfs_attr_leaf.h 2008-01-18 14:50:42.0000000= 00 +1100 +++ ci/xfsprogs/include/xfs_attr_leaf.h 2008-01-18 15:00:09.116560225 +1= 100 @@ -36,6 +36,7 @@ struct xfs_da_state; struct xfs_da_state_blk; struct xfs_inode; +struct xfs_mount; struct xfs_trans; = /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D @@ -192,6 +193,12 @@ return (((bsize) >> 1) + ((bsize) >> 2)); } = +/* + * Do hash based on nameops + */ +#define xfs_attr_hashname(dp, n, l) \ + ((dp)->i_mount->m_attrnameops->hashname((dp), (n), (l))) + = /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D * Structure used to pass context around among the routines. @@ -274,6 +281,7 @@ /* * Utility routines. */ +void xfs_attr_mount(struct xfs_mount *mp); xfs_dahash_t xfs_attr_leaf_lasthash(struct xfs_dabuf *bp, int *count); int xfs_attr_leaf_order(struct xfs_dabuf *leaf1_bp, struct xfs_dabuf *leaf2_bp); Index: ci/xfsprogs/include/xfs_da_btree.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/include/xfs_da_btree.h 2008-01-18 14:50:42.00000000= 0 +1100 +++ ci/xfsprogs/include/xfs_da_btree.h 2008-01-18 15:00:09.124559199 +11= 00 @@ -103,6 +103,15 @@ *=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D*/ = /* + * Search comparison results + */ +typedef enum { + XFS_CMP_DIFFERENT, /* names are completely different */ + XFS_CMP_EXACT, /* names are exactly the same */ + XFS_CMP_CASE /* names are same but differ in case */ +} xfs_dacmp_t; + +/* * Structure to ease passing around component names. */ typedef struct xfs_da_args { @@ -205,12 +214,37 @@ (uint)(XFS_DA_LOGOFF(BASE, ADDR)), \ (uint)(XFS_DA_LOGOFF(BASE, ADDR)+(SIZE)-1) = +/* + * Name ops for directory and/or attr name operations + */ + +typedef xfs_dahash_t (*xfs_hashname_t)(struct xfs_inode *, const uchar_= t *, + int); +typedef xfs_dacmp_t (*xfs_compname_t)(struct xfs_inode *, const uchar_t= *, + int, const uchar_t *, int); + +typedef struct xfs_nameops { + xfs_hashname_t hashname; + xfs_compname_t compname; +} xfs_nameops_t; + = #ifdef __KERNEL__ /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D * Function prototypes for the kernel. *=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D*/ = +extern const struct xfs_nameops xfs_default_nameops; +extern const struct xfs_nameops xfs_unicode_nameops; +extern const struct xfs_nameops xfs_unicode_ci_nameops; + +xfs_dacmp_t xfs_default_compname(struct xfs_inode *inode, const uchar_t= *name1, + int len1, const uchar_t *name2, int len2); + +int xfs_da_setup_name_and_hash(xfs_da_args_t *args, const uchar_t *name= , + int namelen); +void xfs_da_cleanup_name(xfs_da_args_t *args, const uchar_t *name); + /* * Routines used for growing the Btree. */ Index: ci/xfsprogs/include/xfs_dir2.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/include/xfs_dir2.h 2008-01-18 14:50:42.000000000 +1= 100 +++ ci/xfsprogs/include/xfs_dir2.h 2008-01-18 15:00:09.124559199 +1100 @@ -72,6 +72,13 @@ struct uio *uio; /* uio control structure */ } xfs_dir2_put_args_t; = +#define xfs_dir_hashname(dp, n, l) \ + ((dp)->i_mount->m_dirnameops->hashname((dp), (n), (l))) + +#define xfs_dir_compname(dp, n1, l1, n2, l2) \ + ((dp)->i_mount->m_dirnameops->compname((dp), (n1), (l1), \ + (n2), (l2))) + /* * Other interfaces used by the rest of the dir v2 code. */ Index: ci/xfsprogs/include/xfs_unicode.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ci/xfsprogs/include/xfs_unicode.h 2008-01-18 15:00:09.128558686 +110= 0 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2007 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation,= + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#ifndef __XFS_UNICODE_H__ +#define __XFS_UNICODE_H__ + +#define XFS_CFT_MAGIC 0x58434654 /* 'XCFT' */ +#define XFS_CFT_FLAG_TURKIC 0x00000001 +#define XFS_CFT_FLAG_MAX 0x00000001 + +/* + * Case Fold Table - on disk version. Must match the incore version bel= ow. + */ +typedef struct xfs_dcft { + __be32 cft_magic; /* validity check */ + __be32 cft_flags; + uuid_t cft_uuid; /* UUID of the filesystem */ + __be32 cft_crc; /* for future support */ + __be32 cft_num_tables; /* single, double, etc */ + __be32 cft_table_offset[1]; +} xfs_dcft_t; + +/* + * Case Fold Table - in core version. Must match the ondisk version abo= ve. + */ +typedef struct xfs_cft { + __uint32_t cft_magic; + __uint32_t cft_flags; + uuid_t cft_uuid; /* UUID of the filesystem */ + __uint32_t cft_crc; + __uint32_t cft_num_tables; /* single, double, etc */ + __uint32_t cft_table_offset[1];/* num_tables sized */ + /* 16-bit array tables immediately follow */ +} xfs_cft_t; + +#define XFS_CFT_PTR(t,n) (__uint16_t *)(((char *)(t)) + \ + (t)->cft_table_offset[n]) +#define XFS_DCFT_PTR(t,n) (__be16 *)(((char *)(t)) + \ + be32_to_cpu((t)->cft_table_offset[n])) + +__uint32_t xfs_unicode_hash(const xfs_cft_t *cft, + const uchar_t *name, int namelen); + +int xfs_unicode_casecmp(const xfs_cft_t *cft, const uchar_t *name1, + int len1, const uchar_t *name2, int len2); + +char *xfs_alloc_unicode_nls_name(void); +void xfs_free_unicode_nls_name(char *name); + +int xfs_unicode_validate(const uchar_t *name, int namelen); + +int xfs_unicode_read_cft(struct xfs_mount *mp); +void xfs_unicode_free_cft(const xfs_cft_t *cft); + +#endif /* __XFS_UNICODE_H__ */ Index: ci/xfsprogs/libxfs/init.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/libxfs/init.c 2008-01-18 14:50:42.000000000 +1100 +++ ci/xfsprogs/libxfs/init.c 2008-01-18 15:00:09.136557660 +1100 @@ -579,10 +579,14 @@ else libxfs_dir_mount(mp); = - /* Initialize cached values for the attribute manager */ - mp->m_attr_magicpct =3D (mp->m_sb.sb_blocksize * 37) / 100; + /* + * Initialize the attribute manager's entries. + */ + libxfs_attr_mount(mp); = - /* Initialize the precomputed transaction reservations values */ + /* + * Initialize the precomputed transaction reservations values. + */ libxfs_trans_init(mp); = if (dev =3D=3D 0) /* maxtrres, we have no device so leave now */ Index: ci/xfsprogs/libxfs/xfs.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/libxfs/xfs.h 2008-01-18 14:50:42.000000000 +1100 +++ ci/xfsprogs/libxfs/xfs.h 2008-01-18 15:00:09.136557660 +1100 @@ -95,6 +95,8 @@ #define xfs_itobp libxfs_itobp #define xfs_iformat libxfs_iformat #define xfs_ichgtime libxfs_ichgtime +#define xfs_iget(m,t,i,f,lf,ip,b) libxfs_iget(m,t,i,lf,ip,b) +#define xfs_iput libxfs_iput #define xfs_bmapi libxfs_bmapi #define xfs_bmapi_single libxfs_bmapi_single #define xfs_bmap_finish libxfs_bmap_finish @@ -146,6 +148,7 @@ #define xfs_dir2_data_freescan libxfs_dir2_data_freescan #define xfs_dir2_free_log_bests libxfs_dir2_free_log_bests = +#define xfs_attr_mount libxfs_attr_mount #define xfs_attr_leaf_newentsize libxfs_attr_leaf_newentsize #define xfs_attr_set_int libxfs_attr_set_int #define xfs_attr_remove_int libxfs_attr_remove_int @@ -175,7 +178,7 @@ #define xfs_validate_extents(e,n,d,f) ((void) 0) /* debug only */ #define xfs_buf_relse(bp) libxfs_putbuf(bp) #define xfs_read_buf(mp,devp,blkno,len,f,bpp) \ - ( *(bpp) =3D libxfs_readbuf( *(dev_t*)devp, (blkno), (len), 1), 0 ) + ( *(bpp) =3D libxfs_readbuf((devp), (blkno), (len), 1), 0 ) #define xfs_buf_get_flags(devp,blkno,len,f) \ ( libxfs_getbuf( devp, (blkno), (len) ) ) #define xfs_bwrite(mp,bp) libxfs_writebuf((bp), 0) @@ -205,10 +208,13 @@ #define kmem_zone_alloc(z, f) libxfs_zone_zalloc(z) #define kmem_zone_zalloc(z, f) libxfs_zone_zalloc(z) #define kmem_zone_free(z, p) libxfs_zone_free(z, p) +#define kmem_zone_destroy(z) ((void) 0) #define kmem_realloc(p,sz,u,f) libxfs_realloc(p,sz) #define kmem_zalloc(size, f) libxfs_malloc(size) #define kmem_alloc(size, f) libxfs_malloc(size) #define kmem_free(p, size) libxfs_free(p) +#define vmalloc(size) libxfs_malloc(size) +#define vfree(p) libxfs_free(p) = /* directory management */ #define xfs_dir2_trace_args(where, args) ((void) 0) @@ -288,6 +294,8 @@ #define XFS_MOUNT_32BITINODES LIBXFS_MOUNT_32BITINODES #define XFS_MOUNT_32BITINOOPT LIBXFS_MOUNT_32BITINOOPT #define XFS_MOUNT_COMPAT_ATTR LIBXFS_MOUNT_COMPAT_ATTR +#define XFS_MOUNT_CI_LOOKUP 0 /* ignored in userspace */ +#define XFS_MOUNT_CI_ATTR 0 /* ignored in userspace */ #define XFS_ILOCK_EXCL 0 #define xfs_sort qsort #define down_read(a) ((void) 0) @@ -300,6 +308,10 @@ #define spinlock_init(a,b) ((void) 0) #define spin_lock(a) ((void) 0) #define spin_unlock(a) ((void) 0) +#define mutex_t int +#define mutex_init(a) ((void) 0) +#define mutex_lock(a) ((void) 0) +#define mutex_unlock(a) ((void) 0) #define xfs_btree_reada_bufl(m,fsb,c) ((void) 0) #define xfs_btree_reada_bufs(m,fsb,c,x) ((void) 0) #define XFS_SB_LOCK(mp) 0 @@ -559,6 +571,10 @@ xfs_alloc_key_t *, xfs_btree_cur_t **, int *); = /* xfs_da_btree.c */ +xfs_dacmp_t xfs_default_compname(struct xfs_inode *, const uchar_t *, i= nt, + const uchar_t *, int); +int xfs_da_setup_name_and_hash(xfs_da_args_t *, const uchar_t *, int);= +void xfs_da_cleanup_name(xfs_da_args_t *, const uchar_t *); xfs_dabuf_t *xfs_da_buf_make (int, xfs_buf_t **, inst_t *); void xfs_da_binval (struct xfs_trans *, xfs_dabuf_t *); void xfs_da_buf_done (xfs_dabuf_t *); @@ -678,6 +694,8 @@ void xfs_trans_mod_sb (xfs_trans_t *, uint, long); int xfs_trans_unlock_chunk (xfs_log_item_chunk_t *, int, int, xfs_lsn_= t); = +int utf8_mbtowc(wchar_t *p, const __u8 *s, int n); +int utf8_wctomb(__u8 *s, wchar_t wc, int maxlen); = #ifndef DEBUG #define xfs_inobp_check(mp,bp) ((void) 0) Index: ci/xfsprogs/libxfs/xfs_attr.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/libxfs/xfs_attr.c 2008-01-18 14:50:42.000000000 +11= 00 +++ ci/xfsprogs/libxfs/xfs_attr.c 2008-01-18 15:00:09.144556633 +1100 @@ -64,6 +64,17 @@ * Overall external interface routines. *=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D*/ = +void +xfs_attr_mount(struct xfs_mount *mp) +{ + mp->m_attr_magicpct =3D (mp->m_sb.sb_blocksize * 37) / 100; + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + mp->m_attrnameops =3D (mp->m_flags & XFS_MOUNT_CI_ATTR) ? + &xfs_unicode_ci_nameops : &xfs_unicode_nameops; + } else + mp->m_attrnameops =3D &xfs_default_nameops; +} + int xfs_attr_set_int(xfs_inode_t *dp, const char *name, int namelen, char *value, int valuelen, int flags) @@ -103,18 +114,18 @@ * Fill in the arg structure for this request. */ memset((char *)&args, 0, sizeof(args)); - args.name =3D (const uchar_t *)name; - args.namelen =3D namelen; args.value =3D (uchar_t *)value; args.valuelen =3D valuelen; args.flags =3D flags; - args.hashval =3D xfs_da_hashname(args.name, args.namelen); args.dp =3D dp; args.firstblock =3D &firstblock; args.flist =3D &flist; args.whichfork =3D XFS_ATTR_FORK; args.addname =3D 1; args.oknoent =3D 1; + error =3D xfs_da_setup_name_and_hash(&args, (uchar_t *)name, namelen);= + if (error) + return error; = nblks =3D XFS_DAENTER_SPACE_RES(mp, XFS_ATTR_FORK); if (local) { @@ -159,6 +170,7 @@ 0, XFS_TRANS_PERM_LOG_RES, XFS_ATTRSET_LOG_COUNT))) { xfs_trans_cancel(args.trans, 0); + xfs_da_cleanup_name(&args, (uchar_t *)name); return(error); } xfs_ilock(dp, XFS_ILOCK_EXCL); @@ -169,6 +181,7 @@ if (error) { xfs_iunlock(dp, XFS_ILOCK_EXCL); xfs_trans_cancel(args.trans, XFS_TRANS_RELEASE_LOG_RES); + xfs_da_cleanup_name(&args, (uchar_t *)name); return (error); } = @@ -220,6 +233,7 @@ if (!error && (flags & ATTR_KERNOTIME) =3D=3D 0) { xfs_ichgtime(dp, XFS_ICHGTIME_CHG); } + xfs_da_cleanup_name(&args, (uchar_t *)name); return(error =3D=3D 0 ? err2 : error); } = @@ -290,6 +304,7 @@ xfs_ichgtime(dp, XFS_ICHGTIME_CHG); } = + xfs_da_cleanup_name(&args, (uchar_t *)name); return(error); = out: @@ -297,6 +312,7 @@ xfs_trans_cancel(args.trans, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT); xfs_iunlock(dp, XFS_ILOCK_EXCL); + xfs_da_cleanup_name(&args, (uchar_t *)name); return(error); } = @@ -313,21 +329,23 @@ * Fill in the arg structure for this request. */ memset((char *)&args, 0, sizeof(args)); - args.name =3D (const uchar_t *)name; - args.namelen =3D namelen; args.flags =3D flags; - args.hashval =3D xfs_da_hashname(args.name, args.namelen); args.dp =3D dp; args.firstblock =3D &firstblock; args.flist =3D &flist; args.total =3D 0; args.whichfork =3D XFS_ATTR_FORK; + error =3D xfs_da_setup_name_and_hash(&args, (uchar_t *)name, namelen);= + if (error) + return error; = /* * Attach the dquots to the inode. */ - if ((error =3D XFS_QM_DQATTACH(mp, dp, 0))) + if ((error =3D XFS_QM_DQATTACH(mp, dp, 0))) { + xfs_da_cleanup_name(&args, (uchar_t *)name); return (error); + } = /* * Start our first transaction of the day. @@ -355,6 +373,7 @@ 0, XFS_TRANS_PERM_LOG_RES, XFS_ATTRRM_LOG_COUNT))) { xfs_trans_cancel(args.trans, 0); + xfs_da_cleanup_name(&args, (uchar_t *)name); return(error); } = @@ -413,6 +432,7 @@ xfs_ichgtime(dp, XFS_ICHGTIME_CHG); } = + xfs_da_cleanup_name(&args, (uchar_t *)name); return(error); = out: @@ -420,6 +440,7 @@ xfs_trans_cancel(args.trans, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT); xfs_iunlock(dp, XFS_ILOCK_EXCL); + xfs_da_cleanup_name(&args, (uchar_t *)name); return(error); } = Index: ci/xfsprogs/libxfs/xfs_attr_leaf.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/libxfs/xfs_attr_leaf.c 2008-01-18 14:50:42.00000000= 0 +1100 +++ ci/xfsprogs/libxfs/xfs_attr_leaf.c 2008-01-18 15:00:09.152555607 +11= 00 @@ -372,18 +372,19 @@ = sfe =3D &sf->list[0]; for (i =3D 0; i < INT_GET(sf->hdr.count, ARCH_CONVERT); i++) { - nargs.name =3D (const uchar_t *)sfe->nameval; - nargs.namelen =3D sfe->namelen; nargs.value =3D (uchar_t *)&sfe->nameval[nargs.namelen]; nargs.valuelen =3D INT_GET(sfe->valuelen, ARCH_CONVERT); - nargs.hashval =3D xfs_da_hashname((const uchar_t *)sfe->nameval, - sfe->namelen); + error =3D xfs_da_setup_name_and_hash(&nargs, sfe->nameval, + sfe->namelen); + if (error) + goto out; nargs.flags =3D (sfe->flags & XFS_ATTR_SECURE) ? ATTR_SECURE : ((sfe->flags & XFS_ATTR_ROOT) ? ATTR_ROOT : 0); error =3D xfs_attr_leaf_lookup_int(bp, &nargs); /* set a->index */ ASSERT(error =3D=3D ENOATTR); error =3D xfs_attr_leaf_add(bp, &nargs); ASSERT(error !=3D ENOSPC); + xfs_da_cleanup_name(&nargs, sfe->nameval); if (error) goto out; sfe =3D XFS_ATTR_SF_NEXTENTRY(sfe); @@ -1684,7 +1685,7 @@ else break; } - ASSERT((probe >=3D 0) && = + ASSERT((probe >=3D 0) && (!leaf->hdr.count || (probe < INT_GET(leaf->hdr.count, ARCH_CONVERT)))); ASSERT((span <=3D 4) || (INT_GET(entry->hashval, ARCH_CONVERT) Index: ci/xfsprogs/libxfs/xfs_da_btree.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/libxfs/xfs_da_btree.c 2008-01-18 14:50:42.000000000= +1100 +++ ci/xfsprogs/libxfs/xfs_da_btree.c 2008-01-18 15:00:09.156555094 +110= 0 @@ -1540,6 +1540,92 @@ } } = + +static xfs_dahash_t +xfs_default_hashname(xfs_inode_t *inode, const uchar_t *name, int namel= en) +{ + return xfs_da_hashname(name, namelen); +} + +xfs_dacmp_t +xfs_default_compname(xfs_inode_t *inode, const uchar_t *name1, int len1= , + const uchar_t *name2, int len2) +{ + return (len1 =3D=3D len2 && memcmp(name1, name2, len1) =3D=3D 0) ? + XFS_CMP_EXACT : XFS_CMP_DIFFERENT; +} + +static xfs_dahash_t +xfs_unicode_ci_hashname( + xfs_inode_t *inode, + const uchar_t *name, + int namelen) +{ + return xfs_unicode_hash(inode->i_mount->m_cft, name, namelen); +} + +static xfs_dacmp_t +xfs_unicode_ci_compname( + xfs_inode_t *inode, + const uchar_t *name1, + int len1, + const uchar_t *name2, + int len2) +{ + if (len1 =3D=3D len2 && memcmp(name1, name2, len1) =3D=3D 0) + return XFS_CMP_EXACT; + + return xfs_unicode_casecmp(inode->i_mount->m_cft, name1, len1, + name2, len2) =3D=3D 0 ? XFS_CMP_CASE : XFS_CMP_DIFFERENT; +} + +const struct xfs_nameops xfs_default_nameops =3D { + .hashname =3D xfs_default_hashname, + .compname =3D xfs_default_compname +}; + +const struct xfs_nameops xfs_unicode_nameops =3D { + .hashname =3D xfs_unicode_ci_hashname, + .compname =3D xfs_default_compname, +}; + +const struct xfs_nameops xfs_unicode_ci_nameops =3D { + .hashname =3D xfs_unicode_ci_hashname, + .compname =3D xfs_unicode_ci_compname, +}; + +int +xfs_da_setup_name_and_hash( + xfs_da_args_t *args, + const uchar_t *name, + int namelen) +{ + xfs_mount_t *mp =3D args->dp->i_mount; + + /* for libxfs usage, no extended characters should be used */ + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + int rval; + rval =3D xfs_unicode_validate(name, namelen); + if (rval < 0) + return -rval; + } + args->name =3D name; + args->namelen =3D namelen; + args->hashval =3D (args->whichfork =3D=3D XFS_ATTR_FORK) ? + xfs_attr_hashname(args->dp, args->name, args->namelen) : + xfs_dir_hashname(args->dp, args->name, args->namelen); + return 0; +} + +void +xfs_da_cleanup_name( + xfs_da_args_t *args, + const uchar_t *name) +{ + if (args->name !=3D name) + xfs_free_unicode_nls_name((char *)args->name); +} + /* * Add a block to the btree ahead of the file. * Return the new block number to the caller. Index: ci/xfsprogs/libxfs/xfs_dir2.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/libxfs/xfs_dir2.c 2008-01-18 14:50:42.000000000 +11= 00 +++ ci/xfsprogs/libxfs/xfs_dir2.c 2008-01-18 15:00:09.168553554 +1100 @@ -23,6 +23,53 @@ = #include = +/* + * V1 case-insensitive support for directories + */ +static xfs_dahash_t +xfs_ascii_ci_hashname( + xfs_inode_t *inode, + const uchar_t *name, + int namelen) +{ + xfs_dahash_t hash; + int i; + + for (i =3D 0, hash =3D 0; i < namelen; i++) + hash =3D tolower(name[i]) ^ rol32(hash, 7); + + return hash; +} + +static xfs_dacmp_t +xfs_ascii_ci_compname( + xfs_inode_t *inode, + const uchar_t *name1, + int len1, + const uchar_t *name2, + int len2) +{ + xfs_dacmp_t result =3D XFS_CMP_EXACT; + int i; + + if (len1 !=3D len2) + return XFS_CMP_DIFFERENT; + + for (i =3D 0; i < len1; i++) { + if (name1[i] =3D=3D name2[i]) + continue; + if (tolower(name1[i]) !=3D tolower(name2[i])) + return XFS_CMP_DIFFERENT; + result =3D XFS_CMP_CASE; + } + + return result; +} + +static const struct xfs_nameops xfs_ascii_ci_nameops =3D { + .hashname =3D xfs_ascii_ci_hashname, + .compname =3D xfs_ascii_ci_compname, +}; = /* * Initialize directory-related fields in the mount structure. @@ -46,6 +93,13 @@ (mp->m_dirblksize - (uint)sizeof(xfs_da_node_hdr_t)) / (uint)sizeof(xfs_da_node_entry_t); mp->m_dir_magicpct =3D (mp->m_dirblksize * 37) / 100; + + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + mp->m_dirnameops =3D (mp->m_flags & XFS_MOUNT_CI_LOOKUP) ? + &xfs_unicode_ci_nameops : &xfs_unicode_nameops; + } else + mp->m_dirnameops =3D (xfs_sb_version_hasoldci(&mp->m_sb)) ? + &xfs_ascii_ci_nameops : &xfs_default_nameops; } = /* @@ -71,21 +125,21 @@ } = /* - Enter a name in a directory. + * Enter a name in a directory. */ -STATIC int /* error */ +int xfs_dir2_createname( - xfs_trans_t *tp, /* transaction pointer */ - xfs_inode_t *dp, /* incore directory inode */ - uchar_t *name, /* new entry name */ - int namelen, /* new entry name length */ + xfs_trans_t *tp, + xfs_inode_t *dp, + uchar_t *name, + int namelen, xfs_ino_t inum, /* new entry inode number */ xfs_fsblock_t *first, /* bmap's firstblock */ xfs_bmap_free_t *flist, /* bmap's freeblock list */ xfs_extlen_t total) /* bmap's total block count */ { - xfs_da_args_t args; /* operation arguments */ - int rval; /* return value */ + xfs_da_args_t args; + int rval; int v; /* type-checking value */ = ASSERT((dp->i_d.di_mode & S_IFMT) =3D=3D S_IFDIR); @@ -93,12 +147,7 @@ return rval; } XFS_STATS_INC(xs_dir_create); - /* - * Fill in the arg structure for this request. - */ - args.name =3D name; - args.namelen =3D namelen; - args.hashval =3D xfs_da_hashname(name, namelen); + args.inumber =3D inum; args.dp =3D dp; args.firstblock =3D first; @@ -108,48 +157,45 @@ args.trans =3D tp; args.justcheck =3D 0; args.addname =3D args.oknoent =3D 1; - /* - * Decide on what work routines to call based on the inode size. - */ + rval =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (rval) + return rval; + if (dp->i_d.di_format =3D=3D XFS_DINODE_FMT_LOCAL) rval =3D xfs_dir2_sf_addname(&args); - else if ((rval =3D xfs_dir2_isblock(tp, dp, &v))) { - return rval; - } else if (v) + else if ((rval =3D xfs_dir2_isblock(tp, dp, &v))) + goto out; + else if (v) rval =3D xfs_dir2_block_addname(&args); - else if ((rval =3D xfs_dir2_isleaf(tp, dp, &v))) { - return rval; - } else if (v) + else if ((rval =3D xfs_dir2_isleaf(tp, dp, &v))) + goto out; + else if (v) rval =3D xfs_dir2_leaf_addname(&args); else rval =3D xfs_dir2_node_addname(&args); +out: + xfs_da_cleanup_name(&args, name); return rval; } = /* * Lookup a name in a directory, give back the inode number. */ -STATIC int /* error */ +int xfs_dir2_lookup( - xfs_trans_t *tp, /* transaction pointer */ - xfs_inode_t *dp, /* incore directory inode */ - uchar_t *name, /* lookup name */ - int namelen, /* lookup name length */ + xfs_trans_t *tp, + xfs_inode_t *dp, + uchar_t *name, + int namelen, xfs_ino_t *inum) /* out: inode number */ { - xfs_da_args_t args; /* operation arguments */ - int rval; /* return value */ + xfs_da_args_t args; + int rval; int v; /* type-checking value */ = ASSERT((dp->i_d.di_mode & S_IFMT) =3D=3D S_IFDIR); XFS_STATS_INC(xs_dir_lookup); = - /* - * Fill in the arg structure for this request. - */ - args.name =3D name; - args.namelen =3D namelen; - args.hashval =3D xfs_da_hashname(name, namelen); args.inumber =3D 0; args.dp =3D dp; args.firstblock =3D NULL; @@ -159,17 +205,20 @@ args.trans =3D tp; args.justcheck =3D args.addname =3D 0; args.oknoent =3D 1; - /* - * Decide on what work routines to call based on the inode size. - */ + args.value =3D NULL; /* value may contain actual name on return */ + args.valuelen =3D 0; + rval =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (rval) + return rval; + if (dp->i_d.di_format =3D=3D XFS_DINODE_FMT_LOCAL) rval =3D xfs_dir2_sf_lookup(&args); else if ((rval =3D xfs_dir2_isblock(tp, dp, &v))) { - return rval; + goto out; } else if (v) rval =3D xfs_dir2_block_lookup(&args); else if ((rval =3D xfs_dir2_isleaf(tp, dp, &v))) { - return rval; + goto out; } else if (v) rval =3D xfs_dir2_leaf_lookup(&args); else @@ -178,35 +227,32 @@ rval =3D 0; if (rval =3D=3D 0) *inum =3D args.inumber; +out: + xfs_da_cleanup_name(&args, name); return rval; } = /* * Remove an entry from a directory. */ -STATIC int /* error */ +int xfs_dir2_removename( - xfs_trans_t *tp, /* transaction pointer */ - xfs_inode_t *dp, /* incore directory inode */ - uchar_t *name, /* name of entry to remove */ - int namelen, /* name length of entry to remove */ - xfs_ino_t ino, /* inode number of entry to remove */ + xfs_trans_t *tp, + xfs_inode_t *dp, + uchar_t *name, + int namelen, + xfs_ino_t ino, xfs_fsblock_t *first, /* bmap's firstblock */ xfs_bmap_free_t *flist, /* bmap's freeblock list */ xfs_extlen_t total) /* bmap's total block count */ { - xfs_da_args_t args; /* operation arguments */ - int rval; /* return value */ + xfs_da_args_t args; + int rval; int v; /* type-checking value */ = ASSERT((dp->i_d.di_mode & S_IFMT) =3D=3D S_IFDIR); XFS_STATS_INC(xs_dir_remove); - /* - * Fill in the arg structure for this request. - */ - args.name =3D name; - args.namelen =3D namelen; - args.hashval =3D xfs_da_hashname(name, namelen); + args.inumber =3D ino; args.dp =3D dp; args.firstblock =3D first; @@ -215,53 +261,50 @@ args.whichfork =3D XFS_DATA_FORK; args.trans =3D tp; args.justcheck =3D args.addname =3D args.oknoent =3D 0; - /* - * Decide on what work routines to call based on the inode size. - */ + rval =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (rval) + return rval; + if (dp->i_d.di_format =3D=3D XFS_DINODE_FMT_LOCAL) rval =3D xfs_dir2_sf_removename(&args); - else if ((rval =3D xfs_dir2_isblock(tp, dp, &v))) { - return rval; - } else if (v) + else if ((rval =3D xfs_dir2_isblock(tp, dp, &v))) + goto out; + else if (v) rval =3D xfs_dir2_block_removename(&args); - else if ((rval =3D xfs_dir2_isleaf(tp, dp, &v))) { - return rval; - } else if (v) + else if ((rval =3D xfs_dir2_isleaf(tp, dp, &v))) + goto out; + else if (v) rval =3D xfs_dir2_leaf_removename(&args); else rval =3D xfs_dir2_node_removename(&args); +out: + xfs_da_cleanup_name(&args, name); return rval; } = /* * Replace the inode number of a directory entry. */ -STATIC int /* error */ +int xfs_dir2_replace( - xfs_trans_t *tp, /* transaction pointer */ - xfs_inode_t *dp, /* incore directory inode */ + xfs_trans_t *tp, + xfs_inode_t *dp, uchar_t *name, /* name of entry to replace */ - int namelen, /* name length of entry to replace */ + int namelen, xfs_ino_t inum, /* new inode number */ xfs_fsblock_t *first, /* bmap's firstblock */ xfs_bmap_free_t *flist, /* bmap's freeblock list */ xfs_extlen_t total) /* bmap's total block count */ { - xfs_da_args_t args; /* operation arguments */ - int rval; /* return value */ + xfs_da_args_t args; + int rval; int v; /* type-checking value */ = ASSERT((dp->i_d.di_mode & S_IFMT) =3D=3D S_IFDIR); = - if ((rval =3D xfs_dir_ino_validate(tp->t_mountp, inum))) { + if ((rval =3D xfs_dir_ino_validate(tp->t_mountp, inum))) return rval; - } - /* - * Fill in the arg structure for this request. - */ - args.name =3D name; - args.namelen =3D namelen; - args.hashval =3D xfs_da_hashname(name, namelen); + args.inumber =3D inum; args.dp =3D dp; args.firstblock =3D first; @@ -270,21 +313,24 @@ args.whichfork =3D XFS_DATA_FORK; args.trans =3D tp; args.justcheck =3D args.addname =3D args.oknoent =3D 0; - /* - * Decide on what work routines to call based on the inode size. - */ + rval =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (rval) + return rval; + if (dp->i_d.di_format =3D=3D XFS_DINODE_FMT_LOCAL) rval =3D xfs_dir2_sf_replace(&args); - else if ((rval =3D xfs_dir2_isblock(tp, dp, &v))) { - return rval; - } else if (v) + else if ((rval =3D xfs_dir2_isblock(tp, dp, &v))) + goto out; + else if (v) rval =3D xfs_dir2_block_replace(&args); - else if ((rval =3D xfs_dir2_isleaf(tp, dp, &v))) { - return rval; - } else if (v) + else if ((rval =3D xfs_dir2_isleaf(tp, dp, &v))) + goto out; + else if (v) rval =3D xfs_dir2_leaf_replace(&args); else rval =3D xfs_dir2_node_replace(&args); +out: + xfs_da_cleanup_name(&args, name); return rval; } = Index: ci/xfsprogs/libxfs/xfs_unicode.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ci/xfsprogs/libxfs/xfs_unicode.c 2008-01-18 15:00:09.176552528 +1100= @@ -0,0 +1,405 @@ +/* + * Copyright (c) 2007 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation,= + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "xfs.h" +#include "xfs_fs.h" +#include "xfs_bit.h" +#include "xfs_log.h" +#include "xfs_inum.h" +#include "xfs_trans.h" +#include "xfs_sb.h" +#include "xfs_ag.h" +#include "xfs_dir2.h" +#include "xfs_alloc.h" +#include "xfs_mount.h" +#include "xfs_bmap_btree.h" +#include "xfs_alloc_btree.h" +#include "xfs_ialloc_btree.h" +#include "xfs_dir2_sf.h" +#include "xfs_attr_sf.h" +#include "xfs_dinode.h" +#include "xfs_inode.h" +#include "xfs_btree.h" +#include "xfs_ialloc.h" +#include "xfs_rtalloc.h" +#include "xfs_bmap.h" +#include "xfs_unicode.h" + +#define MAX_FOLD_CHARS 4 + +static kmem_zone_t *xfs_nls_uni_zone; + +static inline int +xfs_casefold( + const xfs_cft_t *cft, + __uint16_t c, + __uint16_t *fc) +{ + __uint16_t *table =3D XFS_CFT_PTR(cft, 0); + __uint16_t tmp =3D table[c >> 8]; + int i; + + if (!tmp) { + *fc =3D c; + return 1; + } + tmp =3D table[tmp + (c & 0xff)]; + if ((tmp & 0xf000) !=3D 0xe000) { + *fc =3D tmp; + return 1; + } + i =3D ((tmp >> 10) & 0x3) + 2; + ASSERT(i < cft->cft_num_tables); + table =3D XFS_CFT_PTR(cft, i - 1) + ((tmp & 0x3ff) * i); + + memcpy(fc, table, sizeof(__uint16_t) * i); + + return i; +} + +static inline int +xfs_utf8_casefold( + const xfs_cft_t *cft, + const uchar_t **name, + int *namelen, + __uint16_t *fc) +{ + wchar_t uc; + + if (*namelen =3D=3D 0) + return 0; + + if (**name & 0x80) { + int n =3D utf8_mbtowc(&uc, *name, *namelen); + if (n < 0) { + (*namelen)--; + *fc =3D *(*name)++; + return 1; + } + *name +=3D n; + *namelen -=3D n; + } else { + uc =3D *(*name)++; + (*namelen)--; + } + return xfs_casefold(cft, uc, fc); +} + +__uint32_t +xfs_unicode_hash( + const xfs_cft_t *cft, + const uchar_t *name, + int namelen) +{ + __uint32_t hash =3D 0; + __uint16_t fc[MAX_FOLD_CHARS]; + int nfc; + int i; + + while (namelen > 0) { + nfc =3D xfs_utf8_casefold(cft, &name, &namelen, fc); + for (i =3D 0; i < nfc; i++) + hash =3D fc[i] ^ rol32(hash, 7); + } + return hash; +} + +int +xfs_unicode_casecmp( + const xfs_cft_t *cft, + const uchar_t *name1, + int len1, + const uchar_t *name2, + int len2) +{ + __uint16_t fc1[MAX_FOLD_CHARS], fc2[MAX_FOLD_CHARS]; + __uint16_t *pfc1, *pfc2; + int nfc1, nfc2; + + nfc1 =3D xfs_utf8_casefold(cft, &name1, &len1, fc1); + pfc1 =3D fc1; + nfc2 =3D xfs_utf8_casefold(cft, &name2, &len2, fc2); + pfc2 =3D fc2; + + while (nfc1 > 0 && nfc2 > 0) { + if (*pfc1 !=3D *pfc2) + return (*pfc1 < *pfc2) ? -1 : 1; + if (!--nfc1) { + nfc1 =3D xfs_utf8_casefold(cft, &name1, &len1, fc1); + pfc1 =3D fc1; + } else + pfc1++; + if (!--nfc2) { + nfc2 =3D xfs_utf8_casefold(cft, &name2, &len2, fc2); + pfc2 =3D fc2; + } else + pfc2++; + } + if (nfc1 !=3D nfc2) + return (nfc1 < nfc2) ? -1 : 1; + return 0; +} + + +char * +xfs_alloc_unicode_nls_name(void) +{ + return kmem_zone_alloc(xfs_nls_uni_zone, KM_SLEEP); +} + + +void +xfs_free_unicode_nls_name( + char *name) +{ + kmem_zone_free(xfs_nls_uni_zone, name); +} + + +int +xfs_unicode_validate( + const uchar_t *name, + int namelen) +{ + wchar_t uc; + int i, nlen; + + for (i =3D 0; i < namelen; i +=3D nlen) { + if (*name >=3D 0xf0) + return -EINVAL; + /* utf8_mbtowc must fail on overlong sequences too */ + nlen =3D utf8_mbtowc(&uc, name + i, namelen - i); + if (nlen < 0) + return -EILSEQ; + /* check for invalid/surrogate/private unicode chars */ + if (uc >=3D 0xfffe || (uc >=3D 0xd800 && uc <=3D 0xf8ff)) + return -EINVAL; + } + return 0; +} + +/* + * Unicode Case Fold Table management + */ + +struct cft_item { + xfs_cft_t *table; + int size; + int refcount; +}; + +static mutex_t cft_lock; +static int cft_size; +static struct cft_item *cft_list; + +static xfs_cft_t * +add_cft( + xfs_dcft_t *dcft, + int size) +{ + int found =3D 0; + int i, j; + xfs_cft_t *cft; + __be16 *duc; + __uint16_t *uc; + + mutex_lock(&cft_lock); + + for (i =3D 0; i < cft_size; i++) { + if (cft_list[i].size !=3D size) + continue; + cft =3D cft_list[i].table; + if (cft->cft_num_tables !=3D be32_to_cpu(dcft->cft_num_tables) || + cft->cft_flags !=3D be32_to_cpu(dcft->cft_flags)) + continue; + found =3D 1; + for (j =3D 0; j < cft->cft_num_tables; j++) { + if (cft->cft_table_offset[j] !=3D + be32_to_cpu(dcft->cft_table_offset[j])) { + found =3D 0; + break; + } + } + if (found) { + cft_list[i].refcount++; + mutex_unlock(&cft_lock); + return cft; + } + } + + cft =3D vmalloc(size); + if (!cft) { + mutex_unlock(&cft_lock); + return NULL; + } + cft->cft_magic =3D be32_to_cpu(dcft->cft_magic); + cft->cft_flags =3D be32_to_cpu(dcft->cft_flags); + cft->cft_num_tables =3D be32_to_cpu(dcft->cft_num_tables); + ASSERT(cft->cft_num_tables <=3D MAX_FOLD_CHARS); + for (i =3D 0; i < cft->cft_num_tables; i++) + cft->cft_table_offset[i] =3D be32_to_cpu(dcft->cft_table_offset[i]); + j =3D (size - cft->cft_table_offset[0]) / sizeof(__uint16_t); + uc =3D XFS_CFT_PTR(cft, 0); + duc =3D XFS_DCFT_PTR(dcft, 0); + for (i =3D 0; i < j; i++) + uc[i] =3D be16_to_cpu(duc[i]); + + cft_list =3D kmem_realloc(cft_list, + (cft_size + 1) * sizeof(struct cft_item), + cft_size * sizeof(struct cft_item), KM_SLEEP); + cft_list[cft_size].table =3D cft; + cft_list[cft_size].size =3D size; + cft_list[cft_size].refcount =3D 1; + cft_size++; + + mutex_unlock(&cft_lock); + + return cft; +} + +static void +remove_cft( + const xfs_cft_t *cft) +{ + int i; + + mutex_lock(&cft_lock); + + for (i =3D 0; i < cft_size; i++) { + if (cft_list[i].table =3D=3D cft) { + ASSERT(cft_list[i].refcount > 0); + cft_list[i].refcount--; + break; + } + } + + mutex_unlock(&cft_lock); +} + + +int +xfs_unicode_read_cft( + xfs_mount_t *mp) +{ + int error; + xfs_inode_t *cftip; + int size; + int nfsb; + int nmap; + xfs_bmbt_irec_t *mapp; + int n; + int byte_cnt; + xfs_buf_t *bp; + char *table; + xfs_dcft_t *dcft; + + if (mp->m_sb.sb_cftino =3D=3D NULLFSINO || mp->m_sb.sb_cftino =3D=3D 0= ) + return EINVAL; + error =3D xfs_iget(mp, NULL, mp->m_sb.sb_cftino, 0, 0, &cftip, 0); + if (error) + return error; + ASSERT(cftip !=3D NULL); + + size =3D cftip->i_d.di_size; + nfsb =3D cftip->i_d.di_nblocks; + + table =3D vmalloc(size); + if (!table) { + xfs_iput(cftip, 0); + return ENOMEM; + } + dcft =3D (xfs_dcft_t *)table; + + nmap =3D nfsb; + mapp =3D kmem_alloc(nfsb * sizeof(xfs_bmbt_irec_t), KM_SLEEP); + + error =3D xfs_bmapi(NULL, cftip, 0, nfsb, 0, NULL, 0, mapp, &nmap, NUL= L); + if (error) + goto out; + + for (n =3D 0; n < nmap; n++) { + byte_cnt =3D XFS_FSB_TO_B(mp, mapp[n].br_blockcount); + + error =3D xfs_read_buf(mp, mp->m_ddev_targp, + XFS_FSB_TO_DADDR(mp, mapp[n].br_startblock), + BTOBB(byte_cnt), 0, &bp); + if (error) + goto out; + + if (size < byte_cnt) + byte_cnt =3D size; + size -=3D byte_cnt; + memcpy(table, XFS_BUF_PTR(bp), byte_cnt); + table +=3D byte_cnt; + xfs_buf_relse(bp); + } + + /* verify case table read off disk */ + if (platform_uuid_compare(&dcft->cft_uuid, &mp->m_sb.sb_uuid) !=3D 0) = { + error =3D EINVAL; + goto out; + } + + /* clear UUID for in-memory copy/compare */ + memset(&dcft->cft_uuid, 0, sizeof(dcft->cft_uuid)); + + mp->m_cft =3D add_cft(dcft, cftip->i_d.di_size); + if (mp->m_cft =3D=3D NULL) + error =3D ENOMEM; + +out: + xfs_iput(cftip, 0); + kmem_free(mapp, nfsb * sizeof(xfs_bmbt_irec_t)); + vfree(dcft); + + return error; +} + +void +xfs_unicode_free_cft( + const xfs_cft_t *cft) +{ + remove_cft(cft); +} + +void +xfs_unicode_init(void) +{ + mutex_init(&cft_lock); + xfs_nls_uni_zone =3D kmem_zone_init(MAXNAMELEN, "xfs_nls_uni"); +} + +void +xfs_unicode_uninit(void) +{ + int i; + + mutex_lock(&cft_lock); + + for (i =3D 0; i < cft_size; i++) { + ASSERT(cft_list[i].refcount =3D=3D 0); + vfree(cft_list[i].table); + } + kmem_free(cft_list, cft_size * sizeof(struct cft_item)); + cft_size =3D 0; + cft_list =3D NULL; + + mutex_unlock(&cft_lock); + + kmem_zone_destroy(xfs_nls_uni_zone); +} Index: ci/xfsprogs/mdrestore/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/mdrestore/Makefile 2008-01-18 14:50:43.000000000 +1= 100 +++ ci/xfsprogs/mdrestore/Makefile 2008-01-18 15:00:09.272540212 +1100 @@ -8,7 +8,7 @@ LTCOMMAND =3D xfs_mdrestore CFILES =3D xfs_mdrestore.c = -LLDLIBS =3D $(LIBXFS) $(LIBRT) $(LIBPTHREAD) +LLDLIBS =3D $(LIBXFS) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) LTDEPENDENCIES =3D $(LIBXFS) LLDFLAGS =3D -static = Index: ci/xfsprogs/db/cft.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ci/xfsprogs/db/cft.c 2008-01-18 15:00:09.336532002 +1100 @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation,= + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include "command.h" +#include "type.h" +#include "faddr.h" +#include "fprint.h" +#include "field.h" +#include "io.h" +#include "bit.h" +#include "output.h" +#include "init.h" +#include "inode.h" +#include "bmap.h" + +static int cft_f(int argc, char **argv); +static void cft_help(void); + +static int cft_table_count(void *obj, int startoff); + +static const cmdinfo_t cft_cmd =3D + { "cft", NULL, cft_f, 0, 0, 0, NULL, + "set address to casefold table", cft_help }; + +const field_t cft_hfld[] =3D { + { "", FLDT_CFT, OI(0), C1, 0, TYP_NONE }, + { NULL } +}; + +#define OFF(f) bitize(offsetof(xfs_cft_t, cft_ ## f)) +#define SZ(f) bitszof(xfs_cft_t, cft_ ## f) +const field_t cft_flds[] =3D { + { "magic", FLDT_UINT32X, OI(OFF(magic)), C1, 0, TYP_NONE }, + { "flags", FLDT_UINT32X, OI(OFF(flags)), C1, 0, TYP_NONE }, + { "uuid", FLDT_UUID, OI(OFF(uuid)), C1, 0, TYP_NONE }, + { "crc", FLDT_UINT32X, OI(OFF(crc)), C1, 0, TYP_NONE }, + { "num_tables", FLDT_UINT32D, OI(OFF(num_tables)), C1, 0, TYP_NONE }, + { "table_offset", FLDT_UINT32D, OI(OFF(table_offset)), cft_table_count= , + FLD_ARRAY | FLD_COUNT, TYP_NONE }, + { NULL } +}; + +static void +cft_help(void) +{ + dbprintf( +"\n" +" set address to casefold table\n" +"\n" +" Example:\n" +"\n" +" cft - move location to filesystem casefold table\n" +"\n" +" The casefold table is stored in a file for Unicode aware filesystems.= \n" +" All directory and attribute names are hashed using the casefold table= .\n" +); +} + +static int +cft_f( + int argc, + char **argv) +{ + bmap_ext_t bmp; + xfs_dfiloff_t bno; + int nex; + typnm_t type; + + if (!xfs_sb_version_hasunicode(&mp->m_sb)) { + dbprintf("filesystem does not have a casefold table\n"); + return 0; + } + + set_cur_inode(mp->m_sb.sb_cftino); + type =3D inode_next_type(); + if (!type !=3D TYP_CFT) { + dbprintf("cannot read casefold table\n"); + return 0; + } + + nex =3D 1; + bmap(bno, 1, XFS_DATA_FORK, &nex, &bmp); + if (nex =3D=3D 0) { + dbprintf("casefold table block is unmapped\n"); + return 0; + } + ASSERT(typtab[type].typnm =3D=3D type); + ASSERT(nex =3D=3D 1); + set_cur(&typtab[type], (__int64_t)XFS_FSB_TO_DADDR(mp, bmp.startblock)= , + blkbb, DB_RING_ADD, NULL); + return 0; +} + +void +cft_init(void) +{ + add_command(&cft_cmd); +} + +int +cft_size( + void *obj, + int startoff, + int idx) +{ + return bitize(mp->m_sb.sb_blocksize); +} + +static int +cft_table_count( + void *obj, + int startoff) +{ + xfs_dcft_t *cft; + + ASSERT(startoff =3D=3D 0); + cft =3D obj; + return be32_to_cpu(cft->cft_num_tables); +} Index: ci/xfsprogs/db/cft.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ci/xfsprogs/db/cft.h 2008-01-18 15:00:09.348530462 +1100 @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2008 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation,= + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +extern const struct field cft_flds[]; +extern const struct field cft_hfld[]; + +extern void cft_init(void); +extern int cft_size(void *obj, int startoff, int idx); Index: ci/xfsprogs/libxfs/utf8.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ci/xfsprogs/libxfs/utf8.c 2008-01-18 15:00:09.348530462 +1100 @@ -0,0 +1,85 @@ +/* + * The following was provided by Ken Thompson of AT&T Bell Laboratories= , + * , on Tue, 8 Sep 92 03:22:07 EDT, to the X/Open= + * Joint Internationalization Group. + */ + +#include + +struct utf8_table { + int cmask; + int cval; + int shift; + long lmask; + long lval; +}; + +static const struct utf8_table utf8_table[] =3D +{ + {0x80, 0x00, 0*6, 0x7F, 0, /* 1 byte sequen= ce */}, + {0xE0, 0xC0, 1*6, 0x7FF, 0x80, /* 2 byte sequen= ce */}, + {0xF0, 0xE0, 2*6, 0xFFFF, 0x800, /* 3 byte sequen= ce */}, + {0xF8, 0xF0, 3*6, 0x1FFFFF, 0x10000, /* 4 byte sequen= ce */}, + {0xFC, 0xF8, 4*6, 0x3FFFFFF, 0x200000, /* 5 byte sequen= ce */}, + {0xFE, 0xFC, 5*6, 0x7FFFFFFF, 0x4000000, /* 6 byte sequen= ce */}, + {0, /* end of table */} +}; + +int +utf8_mbtowc(wchar_t *p, const unsigned char *s, int n) +{ + long l; + int c0, c, nc; + const struct utf8_table *t; + + nc =3D 0; + c0 =3D *s; + l =3D c0; + for (t =3D utf8_table; t->cmask; t++) { + nc++; + if ((c0 & t->cmask) =3D=3D t->cval) { + l &=3D t->lmask; + if (l < t->lval) + return -1; + *p =3D l; + return nc; + } + if (n <=3D nc) + return -1; + s++; + c =3D (*s ^ 0x80) & 0xFF; + if (c & 0xC0) + return -1; + l =3D (l << 6) | c; + } + return -1; +} + +int +utf8_wctomb(unsigned char *s, wchar_t wc, int maxlen) +{ + long l; + int c, nc; + const struct utf8_table *t; + + if (!s) + return 0; + + l =3D wc; + nc =3D 0; + for (t =3D utf8_table; t->cmask && maxlen; t++, maxlen--) { + nc++; + if (l <=3D t->lmask) { + c =3D t->shift; + *s =3D t->cval | (l >> c); + while (c > 0) { + c -=3D 6; + s++; + *s =3D 0x80 | ((l >> c) & 0x3F); + } + return nc; + } + } + return -1; +} + Index: ci/xfsprogs/libxfs/xfs_dir2_block.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/libxfs/xfs_dir2_block.c 2008-01-18 14:50:42.0000000= 00 +1100 +++ ci/xfsprogs/libxfs/xfs_dir2_block.c 2008-01-18 15:00:09.352529949 +1= 100 @@ -1046,8 +1046,9 @@ tagp =3D XFS_DIR2_DATA_ENTRY_TAG_P(dep); INT_SET(*tagp, ARCH_CONVERT, (xfs_dir2_data_off_t)((char *)dep - (cha= r *)block)); xfs_dir2_data_log_entry(tp, bp, dep); - INT_SET(blp[2 + i].hashval, ARCH_CONVERT, xfs_da_hashname((const ucha= r_t *)sfep->name, sfep->namelen)); - INT_SET(blp[2 + i].address, ARCH_CONVERT, XFS_DIR2_BYTE_TO_DATAPTR(mp= , + blp[2 + i].hashval =3D cpu_to_be32(xfs_dir_hashname(dp, + sfep->name, sfep->namelen)); + blp[2 + i].address =3D cpu_to_be32(xfs_dir2_byte_to_dataptr(mp, (char *)dep - (char *)block)); offset =3D (int)((char *)(tagp + 1) - (char *)block); if (++i =3D=3D INT_GET(sfp->hdr.count, ARCH_CONVERT)) Index: ci/xfsprogs/libxfs/xfs_dir2_data.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/libxfs/xfs_dir2_data.c 2008-01-18 14:50:42.00000000= 0 +1100 +++ ci/xfsprogs/libxfs/xfs_dir2_data.c 2008-01-18 15:00:09.352529949 +11= 00 @@ -126,7 +126,8 @@ addr =3D XFS_DIR2_DB_OFF_TO_DATAPTR(mp, mp->m_dirdatablk, (xfs_dir2_data_aoff_t) ((char *)dep - (char *)d)); - hash =3D xfs_da_hashname((char *)dep->name, dep->namelen); + hash =3D xfs_dir_hashname(dp, (char *)dep->name, + dep->namelen); for (i =3D 0; i < INT_GET(btp->count, ARCH_CONVERT); i++) { if (INT_GET(lep[i].address, ARCH_CONVERT) =3D=3D addr && INT_GET(lep[i].hashval, ARCH_CONVERT) =3D=3D hash) ------------blQY9A8HShDiztkzvReN2F-- From owner-xfs@oss.sgi.com Thu Jan 17 21:07:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 21:07:56 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0I57lpZ023744 for ; Thu, 17 Jan 2008 21:07:51 -0800 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA08692; Fri, 18 Jan 2008 16:08:00 +1100 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id CB1B458C4C0F; Fri, 18 Jan 2008 16:08:00 +1100 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 971186 - [PATCH 1/4] remove permission check from xfs_change_file_space Message-Id: <20080118050800.CB1B458C4C0F@chook.melbourne.sgi.com> Date: Fri, 18 Jan 2008 16:08:00 +1100 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14174 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs [PATCH 1/4] remove permission check from xfs_change_file_space Both callers of xfs_change_file_space alreaedy do the file->f_mode & FMODE_WRITE check to ensure we have a file descriptor that has been opened for write mode, so there is no need to re-check that with xfs_iaccess. Especially as the later might wrongly deny it for corner cases like file descriptor passing through unix domain sockets. Signed-off-by: Christoph Hellwig Date: Fri Jan 18 16:07:07 AEDT 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-hch Inspected by: Christoph Hellwig 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:30365a fs/xfs/xfs_vnodeops.c - 1.728 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.728&r2=text&tr2=1.727&f=h - remove permission check from xfs_change_file_space From owner-xfs@oss.sgi.com Thu Jan 17 21:10:32 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 21:10:37 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0I5ASCG024216 for ; Thu, 17 Jan 2008 21:10:30 -0800 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA08791; Fri, 18 Jan 2008 16:10:42 +1100 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id B220A58C4C0F; Fri, 18 Jan 2008 16:10:42 +1100 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 971186 - [PATCH 2/4] clean up xfs_swapext Message-Id: <20080118051042.B220A58C4C0F@chook.melbourne.sgi.com> Date: Fri, 18 Jan 2008 16:10:42 +1100 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14175 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs [PATCH 2/4] clean up xfs_swapext - stop using vnodes - use proper multiple label goto unwinding - give the struct file * variables saner names Signed-off-by: Christoph Hellwig Date: Fri Jan 18 16:09:59 AEDT 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-hch Inspected by: Christoph Hellwig 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:30366a fs/xfs/xfs_dfrag.c - 1.64 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dfrag.c.diff?r1=text&tr1=1.64&r2=text&tr2=1.63&f=h - [PATCH 2/4] clean up xfs_swapext From owner-xfs@oss.sgi.com Thu Jan 17 21:12:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 21:12:54 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0I5Ckbc024659 for ; Thu, 17 Jan 2008 21:12:50 -0800 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA08864; Fri, 18 Jan 2008 16:13:01 +1100 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 4AF0F58C4C0F; Fri, 18 Jan 2008 16:13:01 +1100 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 971186 - [PATCH 3/4] stop re-checking permissions in xfs_swapext Message-Id: <20080118051301.4AF0F58C4C0F@chook.melbourne.sgi.com> Date: Fri, 18 Jan 2008 16:13:01 +1100 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14176 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs [PATCH 3/4] stop re-checking permissions in xfs_swapext xfs_swapext should simplify check if we have a writeable file descriptor instead of re-checking the permissions using xfs_iaccess. Add an additional check to refuse O_APPEND file descriptors because swapext is not an append-only write operation. Signed-off-by: Christoph Hellwig Date: Fri Jan 18 16:12:16 AEDT 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-hch Inspected by: Christoph Hellwig 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:30369a fs/xfs/xfs_dfrag.c - 1.65 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dfrag.c.diff?r1=text&tr1=1.65&r2=text&tr2=1.64&f=h - stop re-checking permissions in xfs_swapext From owner-xfs@oss.sgi.com Thu Jan 17 21:17:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 21:18:06 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0I5HrZL025425 for ; Thu, 17 Jan 2008 21:17:58 -0800 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA09078; Fri, 18 Jan 2008 16:18:07 +1100 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id CBC3258C4C0F; Fri, 18 Jan 2008 16:18:07 +1100 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 971186 - [PATCH 4/4] use generic_permission Message-Id: <20080118051807.CBC3258C4C0F@chook.melbourne.sgi.com> Date: Fri, 18 Jan 2008 16:18:07 +1100 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14177 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs [PATCH 4/4] use generic_permission Now that all direct caller of xfs_iaccess are gone we can kill xfs_iaccess and xfs_access and just use generic_permission with a check_acl callback. This is required for the per-mount read-only patchset in -mm to work properly with XFS. Signed-off-by: Christoph Hellwig Date: Fri Jan 18 16:15:08 AEDT 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-hch Inspected by: Christoph Hellwig 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:30370a fs/xfs/xfs_vnodeops.c - 1.729 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.729&r2=text&tr2=1.728&f=h fs/xfs/xfs_acl.h - 1.37 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_acl.h.diff?r1=text&tr1=1.37&r2=text&tr2=1.36&f=h fs/xfs/xfs_acl.c - 1.68 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_acl.c.diff?r1=text&tr1=1.68&r2=text&tr2=1.67&f=h fs/xfs/xfs_inode.c - 1.490 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.490&r2=text&tr2=1.489&f=h fs/xfs/xfs_inode.h - 1.240 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.h.diff?r1=text&tr1=1.240&r2=text&tr2=1.239&f=h fs/xfs/linux-2.6/xfs_iops.c - 1.273 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_iops.c.diff?r1=text&tr1=1.273&r2=text&tr2=1.272&f=h fs/xfs/linux-2.6/xfs_ksyms.c - 1.77 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_ksyms.c.diff?r1=text&tr1=1.77&r2=text&tr2=1.76&f=h fs/xfs/xfs_vnodeops.h - 1.6 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.h.diff?r1=text&tr1=1.6&r2=text&tr2=1.5&f=h - use generic_permission From owner-xfs@oss.sgi.com Thu Jan 17 22:55:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 22:55:22 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0I6tBED002028 for ; Thu, 17 Jan 2008 22:55:15 -0800 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA10874; Fri, 18 Jan 2008 17:55:23 +1100 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id AB1D558C4C0F; Fri, 18 Jan 2008 17:55:23 +1100 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: PARTIAL TAKE 972759 - Move AIL pushing into it's own thread Message-Id: <20080118065523.AB1D558C4C0F@chook.melbourne.sgi.com> Date: Fri, 18 Jan 2008 17:55:23 +1100 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14178 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Move AIL pushing into it's own thread When many hundreds to thousands of threads all try to do simultaneous transactions and the log is in a tail-pushing situation (i.e. full), we can get multiple threads walking the AIL list and contending on the AIL lock. The AIL push is, in effect, a simple I/O dispatch algorithm complicated by the ordering constraints placed on it by the transaction subsystem. It really does not need multiple threads to push on it - even when only a single CPU is pushing the AIL, it can push the I/O out far faster that pretty much any disk subsystem can handle. So, to avoid contention problems stemming from multiple list walkers, move the list walk off into another thread and simply provide a "target" to push to. When a thread requires a push, it sets the target and wakes the push thread, then goes to sleep waiting for the required amount of space to become available in the log. This mechanism should also be a lot fairer under heavy load as the waiters will queue in arrival order, rather than queuing in "who completed a push first" order. Also, by moving the pushing to a separate thread we can do more effectively overload detection and prevention as we can keep context from loop iteration to loop iteration. That is, we can push only part of the list each loop and not have to loop back to the start of the list every time we run. This should also help by reducing the number of items we try to lock and/or push items that we cannot move. Note that this patch is not intended to solve the inefficiencies in the AIL structure and the associated issues with extremely large list contents. That needs to be addresses separately; parallel access would cause problems to any new structure as well, so I'm only aiming to isolate the structure from unbounded parallelism here. Date: Fri Jan 18 17:54:48 AEDT 2008 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/2.6.x-xfs Inspected by: lachlan@sgi.com The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:30371a fs/xfs/xfsidbg.c - 1.342 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.342&r2=text&tr2=1.341&f=h - Modify the AIL debug code to match the new structures and interfaces introduced by the AIL push thread. fs/xfs/xfs_log.c - 1.346 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log.c.diff?r1=text&tr1=1.346&r2=text&tr2=1.345&f=h - Move AIL subsystem intialisation/shutdown into the log mount/unmount code to allow per-log AIL threads to be spawned and reaped. fs/xfs/xfs_trans_priv.h - 1.30 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_trans_priv.h.diff?r1=text&tr1=1.30&r2=text&tr2=1.29&f=h - Define private AIl threading interface functions. fs/xfs/xfs_trans_ail.c - 1.83 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_trans_ail.c.diff?r1=text&tr1=1.83&r2=text&tr2=1.82&f=h - factor the guts of the AIL push code to allow it to be called from a separate thread. Change the push interface to update a target and wake up the push thread instead of doing the push itself. fs/xfs/xfs_mount.h - 1.256 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.h.diff?r1=text&tr1=1.256&r2=text&tr2=1.255&f=h - Define new AIL subsystems structures for abstraction of the internals of the implementation out of the xfs_mount structure. fs/xfs/xfs_mount.c - 1.417 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.417&r2=text&tr2=1.416&f=h - Move AIL subsystem intialisation/shutdown into the log mount/unmount code to allow per-log AIL threads to be spawned and reaped. fs/xfs/xfs_trans.h - 1.147 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_trans.h.diff?r1=text&tr1=1.147&r2=text&tr2=1.146&f=h - Add prototypes for new/changed AIL interfaces. fs/xfs/linux-2.6/xfs_super.c - 1.405 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.405&r2=text&tr2=1.404&f=h - Add thread control code and outer loop for the new xfsaild. From owner-xfs@oss.sgi.com Thu Jan 17 22:59:40 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jan 2008 22:59:45 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0I6xZup002655 for ; Thu, 17 Jan 2008 22:59:39 -0800 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA10957; Fri, 18 Jan 2008 17:59:50 +1100 Received: by chook.melbourne.sgi.com (Postfix, from userid 16346) id 0435658C4C0F; Fri, 18 Jan 2008 17:59:49 +1100 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 972759 - Make xfs_ail_check check less by default Message-Id: <20080118065950.0435658C4C0F@chook.melbourne.sgi.com> Date: Fri, 18 Jan 2008 17:59:49 +1100 (EST) From: dgc@sgi.com (David Chinner) X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14179 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Make xfs_ail_check check less by default Checking the entire AIL on every insert and remove is prohibitively expensive - the sustained sequntial create rate on a single disk drops from about 1800/s to 60/s because of this checking resulting in the xfslogd becoming cpu bound. By default on debug builds, only check the next and previous entries in the list to ensure they are ordered correctly. If you really want, define XFS_TRANS_DEBUG to use the old behaviour. Date: Fri Jan 18 17:59:29 AEDT 2008 Workarea: chook.melbourne.sgi.com:/build/dgc/isms/2.6.x-xfs Inspected by: lachlan@sgi.com The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:30372a fs/xfs/xfs_trans_ail.c - 1.84 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_trans_ail.c.diff?r1=text&tr1=1.84&r2=text&tr2=1.83&f=h - Make exhaustive AIL checking only occur when XFS_TRANS_DEBUG is defined to prevent excessive performance loss on normal debug kernels. From owner-xfs@oss.sgi.com Fri Jan 18 07:04:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jan 2008 07:04:57 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_56 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0IF4q0f019071 for ; Fri, 18 Jan 2008 07:04:54 -0800 X-ASG-Debug-ID: 1200668710-4b0200620000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from gaimboi.tmr.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 26DDC534FFD for ; Fri, 18 Jan 2008 07:05:10 -0800 (PST) Received: from gaimboi.tmr.com (mail.tmr.com [64.65.253.246]) by cuda.sgi.com with ESMTP id E5gCxytx0HKmTrGD for ; Fri, 18 Jan 2008 07:05:10 -0800 (PST) Received: from [127.0.0.1] (gaimboi.tmr.com [127.0.0.1]) by gaimboi.tmr.com (8.12.8/8.12.8) with ESMTP id m0IFOiUX023367; Fri, 18 Jan 2008 10:24:44 -0500 Message-ID: <4790C4BC.90802@tmr.com> Date: Fri, 18 Jan 2008 10:24:44 -0500 From: Bill Davidsen Organization: TMR Associates Inc, Schenectady NY User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.8) Gecko/20061105 SeaMonkey/1.0.6 MIME-Version: 1.0 To: Justin Piszcz CC: Al Boldi , xfs@oss.sgi.com, linux-raid@vger.kernel.org, Alan Piszcz X-ASG-Orig-Subj: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again Subject: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again References: <200801162027.00791.a1426z@gawab.com> <200801170019.04836.a1426z@gawab.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: mail.tmr.com[64.65.253.246] X-Barracuda-Start-Time: 1200668711 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39800 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5493/Thu Jan 17 10:09:26 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14180 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: davidsen@tmr.com Precedence: bulk X-list: xfs Justin Piszcz wrote: > > > On Thu, 17 Jan 2008, Al Boldi wrote: > >> Justin Piszcz wrote: >>> On Wed, 16 Jan 2008, Al Boldi wrote: >>>>> Also, can you retest using dd with different block-sizes? >>> >>> I can do this, moment.. >>> >>> >>> I know about oflag=direct but I choose to use dd with sync and >>> measure the >>> total time it takes. >>> /usr/bin/time -f %E -o ~/$i=chunk.txt bash -c 'dd if=/dev/zero >>> of=/r1/bigfile bs=1M count=10240; sync' >>> >>> So I was asked on the mailing list to test dd with various chunk sizes, >>> here is the length of time it took >>> to write 10 GiB and sync per each chunk size: >>> >>> 4=chunk.txt:0:25.46 >>> 8=chunk.txt:0:25.63 >>> 16=chunk.txt:0:25.26 >>> 32=chunk.txt:0:25.08 >>> 64=chunk.txt:0:25.55 >>> 128=chunk.txt:0:25.26 >>> 256=chunk.txt:0:24.72 >>> 512=chunk.txt:0:24.71 >>> 1024=chunk.txt:0:25.40 >>> 2048=chunk.txt:0:25.71 >>> 4096=chunk.txt:0:27.18 >>> 8192=chunk.txt:0:29.00 >>> 16384=chunk.txt:0:31.43 >>> 32768=chunk.txt:0:50.11 >>> 65536=chunk.txt:2:20.80 >> >> What do you get with bs=512,1k,2k,4k,8k,16k... >> >> >> Thanks! >> >> -- >> Al >> >> - >> To unsubscribe from this list: send the line "unsubscribe linux-raid" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> > > root 4621 0.0 0.0 12404 760 pts/2 D+ 17:53 0:00 mdadm > -S /dev/md3 > root 4664 0.0 0.0 4264 728 pts/5 S+ 17:54 0:00 grep D > > Tried to stop it when it was re-syncing, DEADLOCK :( > > [ 305.464904] md: md3 still in use. > [ 314.595281] md: md_do_sync() got signal ... exiting > > Anyhow, done testing, time to move data back on if I can kill the > resync process w/out deadlock. So does that indicate that there is still a deadlock issue, or that you don't have the latest patches installed? -- Bill Davidsen "Woe unto the statesman who makes war without a reason that will still be valid when the war is over..." Otto von Bismark From owner-xfs@oss.sgi.com Fri Jan 18 07:28:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jan 2008 07:28:30 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_56 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0IFSMNr021252 for ; Fri, 18 Jan 2008 07:28:25 -0800 X-ASG-Debug-ID: 1200670120-4d6000670000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 193B7534F46 for ; Fri, 18 Jan 2008 07:28:40 -0800 (PST) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id ugIrRXyjlAm2cVDR for ; Fri, 18 Jan 2008 07:28:40 -0800 (PST) Received: by lucidpixels.com (Postfix, from userid 1001) id 199051C003F18; Fri, 18 Jan 2008 10:28:40 -0500 (EST) Date: Fri, 18 Jan 2008 10:28:40 -0500 (EST) From: Justin Piszcz X-X-Sender: jpiszcz@p34.internal.lan To: Bill Davidsen cc: Al Boldi , xfs@oss.sgi.com, linux-raid@vger.kernel.org, Alan Piszcz X-ASG-Orig-Subj: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again Subject: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again In-Reply-To: <4790C4BC.90802@tmr.com> Message-ID: References: <200801162027.00791.a1426z@gawab.com> <200801170019.04836.a1426z@gawab.com> <4790C4BC.90802@tmr.com> User-Agent: Alpine 0.999999 (DEB 847 2007-12-06) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1200670121 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39802 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5494/Fri Jan 18 06:23:47 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14181 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Fri, 18 Jan 2008, Bill Davidsen wrote: > Justin Piszcz wrote: >> >> >> On Thu, 17 Jan 2008, Al Boldi wrote: >> >>> Justin Piszcz wrote: >>>> On Wed, 16 Jan 2008, Al Boldi wrote: >>>>>> Also, can you retest using dd with different block-sizes? >>>> >>>> I can do this, moment.. >>>> >>>> >>>> I know about oflag=direct but I choose to use dd with sync and measure >>>> the >>>> total time it takes. >>>> /usr/bin/time -f %E -o ~/$i=chunk.txt bash -c 'dd if=/dev/zero >>>> of=/r1/bigfile bs=1M count=10240; sync' >>>> >>>> So I was asked on the mailing list to test dd with various chunk sizes, >>>> here is the length of time it took >>>> to write 10 GiB and sync per each chunk size: >>>> >>>> 4=chunk.txt:0:25.46 >>>> 8=chunk.txt:0:25.63 >>>> 16=chunk.txt:0:25.26 >>>> 32=chunk.txt:0:25.08 >>>> 64=chunk.txt:0:25.55 >>>> 128=chunk.txt:0:25.26 >>>> 256=chunk.txt:0:24.72 >>>> 512=chunk.txt:0:24.71 >>>> 1024=chunk.txt:0:25.40 >>>> 2048=chunk.txt:0:25.71 >>>> 4096=chunk.txt:0:27.18 >>>> 8192=chunk.txt:0:29.00 >>>> 16384=chunk.txt:0:31.43 >>>> 32768=chunk.txt:0:50.11 >>>> 65536=chunk.txt:2:20.80 >>> >>> What do you get with bs=512,1k,2k,4k,8k,16k... >>> >>> >>> Thanks! >>> >>> -- >>> Al >>> >>> - >>> To unsubscribe from this list: send the line "unsubscribe linux-raid" in >>> the body of a message to majordomo@vger.kernel.org >>> More majordomo info at http://vger.kernel.org/majordomo-info.html >>> >> >> root 4621 0.0 0.0 12404 760 pts/2 D+ 17:53 0:00 mdadm -S >> /dev/md3 >> root 4664 0.0 0.0 4264 728 pts/5 S+ 17:54 0:00 grep D >> >> Tried to stop it when it was re-syncing, DEADLOCK :( >> >> [ 305.464904] md: md3 still in use. >> [ 314.595281] md: md_do_sync() got signal ... exiting >> >> Anyhow, done testing, time to move data back on if I can kill the resync >> process w/out deadlock. > > So does that indicate that there is still a deadlock issue, or that you don't > have the latest patches installed? > > -- > Bill Davidsen > "Woe unto the statesman who makes war without a reason that will still > be valid when the war is over..." Otto von Bismark > I was trying to stop the raid when it was building, vanilla 2.6.23.14. Justin. From owner-xfs@oss.sgi.com Fri Jan 18 07:39:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jan 2008 07:39:36 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0IFdUIT022363 for ; Fri, 18 Jan 2008 07:39:33 -0800 X-ASG-Debug-ID: 1200670789-2e9b00ed0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D21B9535365 for ; Fri, 18 Jan 2008 07:39:49 -0800 (PST) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id Bt2Eh1jmL8g8tjeK for ; Fri, 18 Jan 2008 07:39:49 -0800 (PST) Received: by lucidpixels.com (Postfix, from userid 1001) id DC5B11C005C69; Fri, 18 Jan 2008 10:39:16 -0500 (EST) Date: Fri, 18 Jan 2008 10:39:16 -0500 (EST) From: Justin Piszcz X-X-Sender: jpiszcz@p34.internal.lan To: Greg Cormier cc: linux-raid@vger.kernel.org, xfs@oss.sgi.com, Alan Piszcz X-ASG-Orig-Subj: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again Subject: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again In-Reply-To: <29a863790801180735n379a27f1t4987686b2ec1aa50@mail.gmail.com> Message-ID: References: <29a863790801180735n379a27f1t4987686b2ec1aa50@mail.gmail.com> User-Agent: Alpine 0.999999 (DEB 847 2007-12-06) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1200670789 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39802 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5494/Fri Jan 18 06:23:47 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14182 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Fri, 18 Jan 2008, Greg Cormier wrote: > Justin, thanks for the script. Here's my results. I ran it a few times > with different tests, hence the small number of results you see here, > I slowly trimmed out the obvious not-ideal sizes. Nice, we all love benchmarks!! :) > > System > --- > Athlon64 3500 > 2GB RAM > 4x500GB WD Raid editions, raid 5. SDE is the old 4-platter version > (5000YS), the others are the 3 platter version. Faster :-) Ok. > > /dev/sdb: > Timing buffered disk reads: 240 MB in 3.00 seconds = 79.91 MB/sec > /dev/sdc: > Timing buffered disk reads: 248 MB in 3.01 seconds = 82.36 MB/sec > /dev/sdd: > Timing buffered disk reads: 248 MB in 3.02 seconds = 82.22 MB/sec > /dev/sde: (older model, 4 platters instead of 3) > Timing buffered disk reads: 210 MB in 3.01 seconds = 69.87 MB/sec > /dev/md3: > Timing buffered disk reads: 628 MB in 3.00 seconds = 209.09 MB/sec > > > Testing > --- > Test was : dd if=/dev/zero of=/r1/bigfile bs=1M count=10240; sync > 64-chunka.txt:2:00.63 > 128-chunka.txt:2:00.20 > 256-chunka.txt:2:01.67 > 512-chunka.txt:2:19.90 > 1024-chunka.txt:2:59.32 For your configuration, a 64-256k chunk seems optimal for this, hypothetical benchmark :) > > > Test was : Unraring multipart RAR's, 1.2 gigabytes. Source and dest > drive were the raid array. > 64-chunkc.txt:1:04.20 > 128-chunkc.txt:0:49.37 > 256-chunkc.txt:0:48.88 > 512-chunkc.txt:0:41.20 > 1024-chunkc.txt:0:40.82 1 meg looks like its the best, which is what I use today, 1 MiB chunk offers the best peformance by far, at least with all of my testing (with big files) such as the tests you performed. > > > > So, there's a toss up between 256 and 512. Yeah for DD performance, not real-life. > If I'm interpreting > correctly here, raw throughput is better with 256, but 512 seems to > work better with real-world stuff? Look above, 1 MiB got you the fastest unrar time. > I'll try to think up another test > or two perhaps, and removing 64 as one of the possible options to save > time (mke2fs takes a while on 1.5TB) Also, don't use ext*, XFS can be up to 2-3x faster (in many of the benchmarks). > > Next step will be playing with read aheads and stripe cache sizes I > guess! I'm open to any comments/suggestions you guys have! > > Greg > From owner-xfs@oss.sgi.com Fri Jan 18 07:42:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jan 2008 07:42:52 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0IFgjaf022874 for ; Fri, 18 Jan 2008 07:42:46 -0800 X-ASG-Debug-ID: 1200670984-70ec018a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from fg-out-1718.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F24D75353A3 for ; Fri, 18 Jan 2008 07:43:04 -0800 (PST) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by cuda.sgi.com with ESMTP id UCK4NxgPbzeGyuLi for ; Fri, 18 Jan 2008 07:43:04 -0800 (PST) Received: by fg-out-1718.google.com with SMTP id e12so1141334fga.8 for ; Fri, 18 Jan 2008 07:43:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=mtxX6D0vjPf8xCmNqhQaNkKlUYe6lVQefwf5lDGlqdU=; b=iHa38NxX5XttF9WrHv+PnRQJYuEDoZvQugJ4ZW/dcOumHkBgtrSkY7INp4AalGL/hKIHpMDMEwAHYvUwpu6OUCCp4BwDlem+1bZF7xGvMrzbSxIzYR9SStWMVMDB7OEXBGZ4P3g5W1xlOz7wT4uKgbq1XJbIzz//5m7aSuoJuXA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=nunuuuXq03trUHhvesVkWmXyWq5J6bPNJNGP7GPytDNnYRKBdHu+Az2BUTt1JNjhAKmw5Pnct4w4HnWXvCAqz89YGSm8RYPr+nWJ+uqSl7xcbSx/0ryT3tWEGPAgy/njNKp4tNmIKxv1QF75v7om6qLAzaj58x2U59Zde87XXPA= Received: by 10.86.77.5 with SMTP id z5mr3171017fga.77.1200670982039; Fri, 18 Jan 2008 07:43:02 -0800 (PST) Received: by 10.86.49.1 with HTTP; Fri, 18 Jan 2008 07:43:01 -0800 (PST) Message-ID: <29a863790801180743y2e90e37aj70c556dc9192a15d@mail.gmail.com> Date: Fri, 18 Jan 2008 10:43:01 -0500 From: "Greg Cormier" To: "Justin Piszcz" X-ASG-Orig-Subj: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again Subject: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again Cc: linux-raid@vger.kernel.org, xfs@oss.sgi.com, "Alan Piszcz" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <29a863790801180735n379a27f1t4987686b2ec1aa50@mail.gmail.com> X-Barracuda-Connect: fg-out-1718.google.com[72.14.220.157] X-Barracuda-Start-Time: 1200670984 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39802 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5494/Fri Jan 18 06:23:47 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14183 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: gcormier@gmail.com Precedence: bulk X-list: xfs > Also, don't use ext*, XFS can be up to 2-3x faster (in many of the > benchmarks). I'm going to swap file systems and give it a shot right now! :) How is stability of XFS? I heard recovery is easier with ext2/3 due to more people using it, more tools available, etc? Greg From owner-xfs@oss.sgi.com Fri Jan 18 07:58:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jan 2008 07:58:58 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0IFwqaK023963 for ; Fri, 18 Jan 2008 07:58:54 -0800 X-ASG-Debug-ID: 1200671951-33d202910000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B44C1C85BA9 for ; Fri, 18 Jan 2008 07:59:11 -0800 (PST) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id shQ94LuUH2OkjxBO for ; Fri, 18 Jan 2008 07:59:11 -0800 (PST) Received: by lucidpixels.com (Postfix, from userid 1001) id 28C831C003F18; Fri, 18 Jan 2008 10:58:40 -0500 (EST) Date: Fri, 18 Jan 2008 10:58:40 -0500 (EST) From: Justin Piszcz X-X-Sender: jpiszcz@p34.internal.lan To: Greg Cormier cc: linux-raid@vger.kernel.org, xfs@oss.sgi.com, Alan Piszcz X-ASG-Orig-Subj: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again Subject: Re: Linux Software RAID 5 + XFS Multi-Benchmarks / 10 Raptors Again In-Reply-To: <29a863790801180743y2e90e37aj70c556dc9192a15d@mail.gmail.com> Message-ID: References: <29a863790801180735n379a27f1t4987686b2ec1aa50@mail.gmail.com> <29a863790801180743y2e90e37aj70c556dc9192a15d@mail.gmail.com> User-Agent: Alpine 0.999999 (DEB 847 2007-12-06) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1200671951 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39803 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5494/Fri Jan 18 06:23:47 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14184 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Fri, 18 Jan 2008, Greg Cormier wrote: >> Also, don't use ext*, XFS can be up to 2-3x faster (in many of the >> benchmarks). > > I'm going to swap file systems and give it a shot right now! :) > > How is stability of XFS? I heard recovery is easier with ext2/3 due to > more people using it, more tools available, etc? > > Greg > Recovery is actually easier with XFS because the repair filesystem code is built-into the kernel (you dont need a utility to fix it)-- however, there is xfs_repair (if) the in-kernel-tree part could not fix it. I have been using it for > 4-5 years? now. Also, with CoRaids (ATA over Ethernet) many of them are above 8TB and ext3 only works up to 8TB, so its not even an option any longer. Justin. From owner-xfs@oss.sgi.com Fri Jan 18 09:55:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jan 2008 09:55:47 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0IHtcr0005585 for ; Fri, 18 Jan 2008 09:55:41 -0800 X-ASG-Debug-ID: 1200678956-4d3700e30000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.purevideo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 06780C8B3D7 for ; Fri, 18 Jan 2008 09:55:56 -0800 (PST) Received: from mail.purevideo.com (mail.purevideo.com [208.50.29.149]) by cuda.sgi.com with ESMTP id P9Q2yGmxd7VFBq3w for ; Fri, 18 Jan 2008 09:55:56 -0800 (PST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-ASG-Orig-Subj: RE: Repairing a possibly incomplete xfs_growfs command? Subject: RE: Repairing a possibly incomplete xfs_growfs command? Date: Fri, 18 Jan 2008 09:50:37 -0800 Message-ID: <9CE70E6ED2C2F64FB5537A2973FA4F0253595B@pvn-3001.purevideo.local> In-Reply-To: <20080117234604.GG155407@sgi.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Repairing a possibly incomplete xfs_growfs command? Thread-Index: AchZYmsjs6dxSvl8Rnyvsjilx+KYUgAmKyXw References: <9CE70E6ED2C2F64FB5537A2973FA4F0253595A@pvn-3001.purevideo.local> <20080117234604.GG155407@sgi.com> From: "Mark Magpayo" To: "David Chinner" Cc: X-Barracuda-Connect: mail.purevideo.com[208.50.29.149] X-Barracuda-Start-Time: 1200678957 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39809 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5495/Fri Jan 18 09:03:36 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m0IHtfr0005587 X-archive-position: 14185 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: mmagpayo@purevideo.com Precedence: bulk X-list: xfs > > So is this all I need then prior to an xfs_repair?: > > > > > # for i in `seq 0 1 63`; do > > > > xfs_db -x -c "sb $i" -c 'write agcount 64' -c 'write dblock > 4761733120' > > > /dev/vg0/lv0 > > Yes, I think that is all that is necessary (that+repair was what fixed > the problem at the customer site successfully). > Is this supposed to be the proper output to the command above? purenas:~# for i in `seq 0 1 63`; do xfs_db -x -c "sb $i" -c 'write agcount 64' -c 'write dblock 4761733120' /dev/vg0/lv0; done agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error agcount = 64 field dblock not found parsing error Hopefully I just mis-typed something? Thanks, Mark From owner-xfs@oss.sgi.com Fri Jan 18 10:05:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jan 2008 10:05:29 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0II5PiB006683 for ; Fri, 18 Jan 2008 10:05:26 -0800 X-ASG-Debug-ID: 1200679539-4d6001990000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.lichtvoll.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8D7A3536429 for ; Fri, 18 Jan 2008 10:05:40 -0800 (PST) Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by cuda.sgi.com with ESMTP id ArwJl6PTOd3g4UH7 for ; Fri, 18 Jan 2008 10:05:40 -0800 (PST) Received: from [192.168.1.21] (dslb-084-056-113-002.pools.arcor-ip.net [84.56.113.2]) by mail.lichtvoll.de (Postfix) with ESMTP id 00D275AD29 for ; Fri, 18 Jan 2008 19:04:16 +0100 (CET) From: Martin Steigerwald To: linux-xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [REVIEW 0/2] Case insensitive support for XFS Subject: Re: [REVIEW 0/2] Case insensitive support for XFS Date: Fri, 18 Jan 2008 19:05:04 +0100 User-Agent: KMail/1.9.7 References: (sfid-20080118_105816_866313_50CC6B33) In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801181905.05263.Martin@lichtvoll.de> X-Barracuda-Connect: mondschein.lichtvoll.de[194.150.191.11] X-Barracuda-Start-Time: 1200679544 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39811 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5495/Fri Jan 18 09:03:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14186 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Martin@lichtvoll.de Precedence: bulk X-list: xfs Hi Barry! Am Freitag 18 Januar 2008 schrieb Barry Naujok: > There are two mount options for enabling case-insensitivity > on a Unicode XFS filesystem: > - "ci" - enables case-insensitivity for file names > - "ciattr" - enables case-insensitivity for extended > attributes. How do I know that I am on an Unicode XFS filesystem. Could I see this with xfs_db -r -c 'sb 0' -c p ? Hmm, nothing unicode related in there as far as I can see. The fs was created with 2.6.23, mkfs.xfs 2.9.4 and the mkfs options that David suggested. Do I need to backup / mkfs / restore to switch to one? I understand that I can switch between enable / disable case-insensitivity via a mount option. Would I be able to enable unicode via xfs_db version command or something like it? Just curious. Ciao, -- Martin 'Helios' Steigerwald - http://www.Lichtvoll.de GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7 From owner-xfs@oss.sgi.com Fri Jan 18 10:34:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jan 2008 10:34:24 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0IIYFKs009471 for ; Fri, 18 Jan 2008 10:34:19 -0800 X-ASG-Debug-ID: 1200681274-4d3601540000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AB268C8EF82 for ; Fri, 18 Jan 2008 10:34:34 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by cuda.sgi.com with ESMTP id CAoe1MxY9DZhN7GP for ; Fri, 18 Jan 2008 10:34:34 -0800 (PST) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m0IIYXEV001673; Fri, 18 Jan 2008 13:34:33 -0500 Received: from lacrosse.corp.redhat.com (lacrosse.corp.redhat.com [172.16.52.154]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m0IIYWoC024958; Fri, 18 Jan 2008 13:34:32 -0500 Received: from neon.msp.redhat.com (neon.msp.redhat.com [10.15.80.10]) by lacrosse.corp.redhat.com (8.12.11.20060308/8.11.6) with ESMTP id m0IIYVd7015612; Fri, 18 Jan 2008 13:34:32 -0500 Message-ID: <4790F137.7000700@sandeen.net> Date: Fri, 18 Jan 2008 12:34:31 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (X11/20071115) MIME-Version: 1.0 To: Mark Magpayo CC: David Chinner , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Repairing a possibly incomplete xfs_growfs command? Subject: Re: Repairing a possibly incomplete xfs_growfs command? References: <9CE70E6ED2C2F64FB5537A2973FA4F0253595A@pvn-3001.purevideo.local> <20080117234604.GG155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253595B@pvn-3001.purevideo.local> In-Reply-To: <9CE70E6ED2C2F64FB5537A2973FA4F0253595B@pvn-3001.purevideo.local> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Barracuda-Connect: mx1.redhat.com[66.187.233.31] X-Barracuda-Start-Time: 1200681274 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39813 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5495/Fri Jan 18 09:03:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14187 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 Mark Magpayo wrote: >>> So is this all I need then prior to an xfs_repair?: >>> >>>> # for i in `seq 0 1 63`; do >>>>> xfs_db -x -c "sb $i" -c 'write agcount 64' -c 'write dblock >> 4761733120' >>>> /dev/vg0/lv0 >> Yes, I think that is all that is necessary (that+repair was what fixed >> the problem at the customer site successfully). >> > > Is this supposed to be the proper output to the command above? > > purenas:~# for i in `seq 0 1 63`; do xfs_db -x -c "sb $i" -c 'write > agcount 64' -c 'write dblock 4761733120' /dev/vg0/lv0; done > agcount = 64 > field dblock not found ... I think dave had a typo, should be dblocks with an "s" on the end. Feel free to wait for his confirmation, though, since this is surgery, after all :) -eric From owner-xfs@oss.sgi.com Fri Jan 18 13:23:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jan 2008 13:23:16 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0ILNC9S025858 for ; Fri, 18 Jan 2008 13:23:13 -0800 X-ASG-Debug-ID: 1200691410-2c5000ca0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5E15D5376AA for ; Fri, 18 Jan 2008 13:23:30 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id XJ9DjuHwsfc9J9Qr for ; Fri, 18 Jan 2008 13:23:30 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 73F3918D92255; Fri, 18 Jan 2008 15:23:28 -0600 (CST) Message-ID: <479118CF.1020302@sandeen.net> Date: Fri, 18 Jan 2008 15:23:27 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Barry Naujok CC: "xfs@oss.sgi.com" , xfs-dev X-ASG-Orig-Subj: Re: [REVIEW 2/2] Case insensitive support for XFS - user-space Subject: Re: [REVIEW 2/2] Case insensitive support for XFS - user-space References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200691411 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.52 X-Barracuda-Spam-Status: No, SCORE=-0.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=BSF_RULE_7580D, BSF_RULE_7580G X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39825 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.75 BSF_RULE_7580D BODY: Custom Rule 7580D 0.75 BSF_RULE_7580G BODY: Custom Rule 7580G X-Virus-Scanned: ClamAV 0.91.2/5495/Fri Jan 18 09:03:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14188 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Barry Naujok wrote: > This patch relies on the dinode.c refactoring patch posted recently. > I have attached the latest version (with fixes pointed out by Chandan). So, new mkfs.xfs -h output says: /* naming */ [-n log=n|size=num,version=n,utf8=none|default|turkic] so I tried: mkfs.xfs -dfile,name=fsfile,size=500m -nutf8=none and got: Illegal value none for -n utf8 option (are there man page updates lurking somewhere? Pls also update Documentation/filesystems/xfs.txt in the kernel) .... Also, if I specify -nutf8=default on a 500m fs: # mkfs.xfs -dfile,name=fsfile,size=500m -nutf8=default meta-data=fsfile isize=256 agcount=4, agsize=32000 blks = sectsz=512 attr=2 data = bsize=4096 blocks=128000, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 utf8=default log =internal log bsize=4096 blocks=1200, version=2 = sectsz=512 sunit=0 blks, lazy-count=0 realtime =none extsz=4096 blocks=0, rtextents=0 mkfs.xfs: cannot reserve space: No space left on device However this works: # mkfs.xfs -dfile,name=fsfile,size=500m as does this: # mkfs.xfs -dfile,name=fsfile,size=1000m -nutf8=default eh? :) -Eric From owner-xfs@oss.sgi.com Fri Jan 18 13:45:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jan 2008 13:45:16 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0ILj6CO027277 for ; Fri, 18 Jan 2008 13:45:07 -0800 X-ASG-Debug-ID: 1200692723-366401180000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.g-house.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6FF80C92A75 for ; Fri, 18 Jan 2008 13:45:24 -0800 (PST) Received: from mail.g-house.de (ns2.g-housing.de [81.169.133.75]) by cuda.sgi.com with ESMTP id zsbLoffF6koSEqAD for ; Fri, 18 Jan 2008 13:45:24 -0800 (PST) Received: from [89.49.164.181] (helo=sheep.housecafe.de) by mail.g-house.de with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1JFz1i-00075c-M5; Fri, 18 Jan 2008 22:45:26 +0100 Received: from sheep.housecafe.de ([192.168.10.10]) by sheep.housecafe.de with esmtp (Exim 4.68) (envelope-from ) id 1JFz1Z-0003DM-9l; Fri, 18 Jan 2008 22:45:17 +0100 Date: Fri, 18 Jan 2008 22:45:17 +0100 (CET) From: Christian Kujau X-X-Sender: evil@sheep.housecafe.de To: xfs@oss.sgi.com cc: LKML X-ASG-Orig-Subj: 2.6.24-rc8: possible circular locking dependency detected Subject: 2.6.24-rc8: possible circular locking dependency detected Message-ID: User-Agent: Alpine 1.00 (DEB 882 2007-12-20) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Barracuda-Connect: ns2.g-housing.de[81.169.133.75] X-Barracuda-Start-Time: 1200692724 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39827 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5495/Fri Jan 18 09:03:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14189 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lists@nerdbynature.de Precedence: bulk X-list: xfs Hi, just FYI, upgrading to -rc8 gave the following messages in kern.log in the morning hours, when the backups were run: ======================================================= [ INFO: possible circular locking dependency detected ] 2.6.24-rc8 #2 ------------------------------------------------------- rsync/23295 is trying to acquire lock: (iprune_mutex){--..}, at: [] shrink_icache_memory+0x72/0x220 but task is already holding lock: (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x96/0xb0 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&(&ip->i_iolock)->mr_lock){----}: [] __lock_acquire+0xbe1/0x10b0 [] xfs_ilock+0x96/0xb0 [] trace_hardirqs_on+0x9f/0x140 [] lock_acquire+0x5f/0x80 [] xfs_ilock+0x96/0xb0 [] down_write_nested+0x41/0x60 [] xfs_ilock+0x96/0xb0 [] xfs_ilock+0x96/0xb0 [] xfs_ireclaim+0x1a/0x60 [] xfs_finish_reclaim+0x53/0x1a0 [] xfs_fs_clear_inode+0x5e/0x90 [] clear_inode+0x82/0x160 [] shrink_icache_memory+0x7c/0x220 [] dispose_list+0x1a/0xc0 [] shrink_icache_memory+0x1e2/0x220 [] shrink_slab+0x101/0x160 [] kswapd+0x2aa/0x410 [] autoremove_wake_function+0x0/0x40 [] kswapd+0x0/0x410 [] kthread+0x42/0x70 Full dmesg and .config: http://nerdbynature.de/bits/2.6.24-rc8/ Thanks, Christian. -- BOFH excuse #18: excess surge protection From owner-xfs@oss.sgi.com Fri Jan 18 16:40:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jan 2008 16:40:45 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0J0eCl4009114 for ; Fri, 18 Jan 2008 16:40:15 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA07790; Sat, 19 Jan 2008 11:40:22 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0J0eKLF28547091; Sat, 19 Jan 2008 11:40:21 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0J0eIvv30085033; Sat, 19 Jan 2008 11:40:18 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Sat, 19 Jan 2008 11:40:18 +1100 From: David Chinner To: Mark Magpayo Cc: David Chinner , xfs@oss.sgi.com Subject: Re: Repairing a possibly incomplete xfs_growfs command? Message-ID: <20080119004018.GH155407@sgi.com> References: <9CE70E6ED2C2F64FB5537A2973FA4F0253595A@pvn-3001.purevideo.local> <20080117234604.GG155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253595B@pvn-3001.purevideo.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9CE70E6ED2C2F64FB5537A2973FA4F0253595B@pvn-3001.purevideo.local> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5495/Fri Jan 18 09:03:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14190 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Fri, Jan 18, 2008 at 09:50:37AM -0800, Mark Magpayo wrote: > > > So is this all I need then prior to an xfs_repair?: > > > > > > > # for i in `seq 0 1 63`; do > > > > > xfs_db -x -c "sb $i" -c 'write agcount 64' -c 'write dblock > > 4761733120' > > > > /dev/vg0/lv0 > > > > Yes, I think that is all that is necessary (that+repair was what fixed > > the problem at the customer site successfully). > > > > Is this supposed to be the proper output to the command above? > > purenas:~# for i in `seq 0 1 63`; do xfs_db -x -c "sb $i" -c 'write > agcount 64' -c 'write dblock 4761733120' /dev/vg0/lv0; done > agcount = 64 > field dblock not found > parsing error Ah - As eric pointed out, that should be "dblocks". Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Fri Jan 18 21:23:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jan 2008 21:23:18 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33, J_CHICKENPOX_41,J_CHICKENPOX_42,J_CHICKENPOX_45,J_CHICKENPOX_47, J_CHICKENPOX_48,J_CHICKENPOX_66,J_CHICKENPOX_71 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0J5N7ER032679 for ; Fri, 18 Jan 2008 21:23:09 -0800 X-ASG-Debug-ID: 1200720200-1905005d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 24ED353922C for ; Fri, 18 Jan 2008 21:23:20 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id U1wkyz3b2uhYBeud for ; Fri, 18 Jan 2008 21:23:20 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 9F7A618D92255; Fri, 18 Jan 2008 23:22:47 -0600 (CST) Message-ID: <47918927.2000603@sandeen.net> Date: Fri, 18 Jan 2008 23:22:47 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Barry Naujok CC: "xfs@oss.sgi.com" , xfs-dev X-ASG-Orig-Subj: Re: [REVIEW 1/2] Case insensitive support for XFS - kernel patch Subject: Re: [REVIEW 1/2] Case insensitive support for XFS - kernel patch References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200720204 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39855 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5495/Fri Jan 18 09:03:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14191 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Barry Naujok wrote: > This patch should apply to 2.6.24-rc6. actually doesn't seem to; at least doesn't apply to rc8... mount handling has moved, etc - well, easy enough to fix up. The samba guys are excited about this, I bet :) Lots of comments below; keep an open mind and a sense of humor, most aren't demands but ideas, musings etc... > =========================================================================== > fs/xfs/Makefile > =========================================================================== > > --- a/fs/xfs/Makefile 2008-01-18 15:31:23.000000000 +1100 > +++ b/fs/xfs/Makefile 2007-10-23 16:17:22.173903950 +1000 > @@ -74,6 +74,7 @@ xfs-y += xfs_alloc.o \ > xfs_trans_extfree.o \ > xfs_trans_inode.o \ > xfs_trans_item.o \ > + xfs_unicode.o \ obj-$(CONFIG_XFS_UNICODE) perhaps? It's a lot of new code that not everyone needs? > xfs_utils.o \ > xfs_vfsops.o \ > xfs_vnodeops.o \ > ... > =========================================================================== > fs/xfs/linux-2.6/xfs_iops.c > =========================================================================== > > --- a/fs/xfs/linux-2.6/xfs_iops.c 2008-01-18 15:31:23.000000000 +1100 > +++ b/fs/xfs/linux-2.6/xfs_iops.c 2008-01-17 12:26:26.905427167 +1100 > @@ -47,6 +47,8 @@ > #include "xfs_buf_item.h" > #include "xfs_utils.h" > #include "xfs_vnodeops.h" > +#include "xfs_da_btree.h" > +#include "xfs_unicode.h" > > #include > #include > @@ -388,7 +390,7 @@ xfs_vn_lookup( > if (dentry->d_name.len >= MAXNAMELEN) > return ERR_PTR(-ENAMETOOLONG); > > - error = xfs_lookup(XFS_I(dir), dentry, &cvp); > + error = xfs_lookup(XFS_I(dir), dentry, &cvp, NULL, NULL); > if (unlikely(error)) { > if (unlikely(error != ENOENT)) > return ERR_PTR(-error); > @@ -399,6 +401,113 @@ xfs_vn_lookup( > return d_splice_alias(vn_to_inode(cvp), dentry); > } > > +STATIC struct dentry * > +xfs_vn_ci_lookup( > + struct inode *dir, > + struct dentry *dentry, > + struct nameidata *nd) > +{ > + bhv_vnode_t *cvp; > + int error; > + struct dentry *result; > + struct qstr actual_name; > + struct inode *inode; > + > + if (dentry->d_name.len >= MAXNAMELEN) > + return ERR_PTR(-ENAMETOOLONG); > + > + error = xfs_lookup(XFS_I(dir), dentry, &cvp, (char **)&actual_name.name, > + &actual_name.len); > + if (unlikely(error)) { > + if (unlikely(error != ENOENT)) > + return ERR_PTR(-error); > + d_add(dentry, NULL); > + return NULL; > + } > + inode = vn_to_inode(cvp); > + > + /* if exact match, just splice and exit */ > + if (!actual_name.name) { > + result = d_splice_alias(inode, dentry); > + return result; > + } > + > + /* > + * case-insensitive match, create a dentry to return and fill it > + * in with the correctly cased name. Parameter "dentry" is not > + * used anymore and the caller will free it. > + * Derived from fs/ntfs/namei.c > + */ > + > + actual_name.hash = full_name_hash(actual_name.name, actual_name.len); > + > + /* Does an existing dentry match? */ > + result = d_lookup(dentry->d_parent, &actual_name); > + if (!result) { > + /* if not, create one */ > + result = d_alloc(dentry->d_parent, &actual_name); > + xfs_free_unicode_nls_name((char *)actual_name.name); > + if (!result) > + return ERR_PTR(-ENOMEM); > + dentry = d_splice_alias(inode, result); > + if (dentry) { > + dput(result); > + return dentry; > + } > + return result; > + } > + xfs_free_unicode_nls_name((char *)actual_name.name); > + > + /* an existing dentry matches, use it */ > + > + if (result->d_inode) { > + /* > + * already an inode attached, deref the inode that was > + * refcounted with xfs_lookup and return the dentry. > + */ > + if (unlikely(result->d_inode != inode)) { > + /* This can happen because bad inodes are unhashed. */ > + BUG_ON(!is_bad_inode(inode)); > + BUG_ON(!is_bad_inode(result->d_inode)); > + } > + iput(inode); > + return result; > + } > + > + if (!S_ISDIR(inode->i_mode)) { > + /* not a directory, easy to handle */ > + d_instantiate(result, inode); > + return result; > + } > + > + spin_lock(&dcache_lock); > + if (list_empty(&inode->i_dentry)) { > + /* > + * Directory without a 'disconnected' dentry; we need to do > + * d_instantiate() by hand because it takes dcache_lock which > + * we already hold. > + */ > + list_add(&result->d_alias, &inode->i_dentry); > + result->d_inode = inode; > + spin_unlock(&dcache_lock); > + security_d_instantiate(result, inode); > + return result; > + } > + /* > + * Directory with a 'disconnected' dentry; get a reference to the > + * 'disconnected' dentry. > + */ > + dentry = list_entry(inode->i_dentry.next, struct dentry, d_alias); > + dget_locked(dentry); > + spin_unlock(&dcache_lock); > + security_d_instantiate(result, inode); > + d_move(dentry, result); > + iput(inode); > + dput(result); > + return dentry; > +} > + > + It seems like it might be nice to make the CI code a compile-time option? Fairly big new chunks... if it could be done cleanly, might be nice... > =========================================================================== > fs/xfs/linux-2.6/xfs_linux.h > =========================================================================== > > --- a/fs/xfs/linux-2.6/xfs_linux.h 2008-01-18 15:31:24.000000000 +1100 > +++ b/fs/xfs/linux-2.6/xfs_linux.h 2008-01-11 14:49:16.537591564 +1100 > @@ -75,6 +75,8 @@ > #include > #include > #include > +#include > +#include > > #include > #include > @@ -180,6 +182,12 @@ > #define howmany(x, y) (((x)+((y)-1))/(y)) > > /* > + * NLS UTF-8 character set > + */ > + > +#define XFS_NLS_UTF8 "utf8" I guess that had to go somewhere? :) > + > +/* > * Various platform dependent calls that don't fit anywhere else > */ > #define xfs_sort(a,n,s,fn) sort(a,n,s,fn,NULL) > > =========================================================================== > fs/xfs/linux-2.6/xfs_super.c > =========================================================================== > > --- a/fs/xfs/linux-2.6/xfs_super.c 2008-01-18 15:31:24.000000000 +1100 > +++ b/fs/xfs/linux-2.6/xfs_super.c 2008-01-11 14:46:25.067566854 +1100 > @@ -50,6 +50,7 @@ > #include "xfs_vnodeops.h" > #include "xfs_vfsops.h" > #include "xfs_version.h" > +#include "xfs_unicode.h" > #include "xfs_log_priv.h" > > #include > @@ -121,6 +122,9 @@ xfs_args_allocate( > #define MNTOPT_ATTR2 "attr2" /* do use attr2 attribute format */ > #define MNTOPT_NOATTR2 "noattr2" /* do not use attr2 attribute format */ > #define MNTOPT_FILESTREAM "filestreams" /* use filestreams allocator */ > +#define MNTOPT_NLS "nls" /* NLS code page to use */ > +#define MNTOPT_CILOOKUP "ci" /* case-insensitive dir names */ > +#define MNTOPT_CIATTR "ciattr" /* case-insensitive attr names */ > #define MNTOPT_QUOTA "quota" /* disk quotas (user) */ > #define MNTOPT_NOQUOTA "noquota" /* no quotas */ > #define MNTOPT_USRQUOTA "usrquota" /* user quota enabled */ Please document in Documentation/filesystems/xfs.txt too... > @@ -315,6 +319,18 @@ xfs_parseargs( > args->flags &= ~XFSMNT_ATTR2; > } else if (!strcmp(this_char, MNTOPT_FILESTREAM)) { > args->flags2 |= XFSMNT2_FILESTREAMS; > + } else if (!strcmp(this_char, MNTOPT_NLS)) { > + if (!value || !*value) { > + cmn_err(CE_WARN, > + "XFS: %s option requires an argument", > + this_char); > + return EINVAL; > + } > + strncpy(args->nls, value, MAXNAMELEN); > + } else if (!strcmp(this_char, MNTOPT_CILOOKUP)) { > + args->flags2 |= XFSMNT2_CILOOKUP; > + } else if (!strcmp(this_char, MNTOPT_CIATTR)) { > + args->flags2 |= XFSMNT2_CIATTR; > } else if (!strcmp(this_char, MNTOPT_NOQUOTA)) { > args->flags &= ~(XFSMNT_UQUOTAENF|XFSMNT_UQUOTA); > args->flags &= ~(XFSMNT_GQUOTAENF|XFSMNT_GQUOTA); > @@ -454,6 +470,8 @@ xfs_showargs( > { XFS_MOUNT_OSYNCISOSYNC, "," MNTOPT_OSYNCISOSYNC }, > { XFS_MOUNT_ATTR2, "," MNTOPT_ATTR2 }, > { XFS_MOUNT_FILESTREAMS, "," MNTOPT_FILESTREAM }, > + { XFS_MOUNT_CI_LOOKUP, "," MNTOPT_CILOOKUP }, > + { XFS_MOUNT_CI_ATTR, "," MNTOPT_CIATTR }, > { XFS_MOUNT_DMAPI, "," MNTOPT_DMAPI }, > { XFS_MOUNT_GRPID, "," MNTOPT_GRPID }, > { 0, NULL } > @@ -516,6 +534,13 @@ xfs_showargs( > if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) > seq_puts(m, "," MNTOPT_NOQUOTA); > > + if (xfs_sb_version_hasunicode(&mp->m_sb)) { > + if (mp->m_nls) > + seq_printf(m, "," MNTOPT_NLS "=%s", mp->m_nls->charset); > + else > + seq_puts(m, "," MNTOPT_NLS "=" XFS_NLS_UTF8); > + } > + > return 0; > } > __uint64_t > @@ -563,7 +588,11 @@ xfs_set_inodeops( > inode->i_mapping->a_ops = &xfs_address_space_operations; > break; > case S_IFDIR: > - inode->i_op = &xfs_dir_inode_operations; > + inode->i_op = > + xfs_sb_version_hasoldci(&XFS_I(inode)->i_mount->m_sb) || > + (XFS_I(inode)->i_mount->m_flags & XFS_MOUNT_CI_LOOKUP) ? > + &xfs_dir_ci_inode_operations : > + &xfs_dir_inode_operations; Do any linux filesystems in existence actually have XFS_SB_VERSION_OLDCIBIT? I'd think not - this patch is *adding* that macro - what's this for? > inode->i_fop = &xfs_dir_file_operations; > break; > case S_IFLNK: > > =========================================================================== > fs/xfs/xfs_attr.c > =========================================================================== > > --- a/fs/xfs/xfs_attr.c 2008-01-18 15:31:24.000000000 +1100 > +++ b/fs/xfs/xfs_attr.c 2008-01-18 13:25:20.068339942 +1100 > @@ -106,6 +106,17 @@ ktrace_t *xfs_attr_trace_buf; > * Overall external interface routines. > *========================================================================*/ > > +void > +xfs_attr_mount(struct xfs_mount *mp) > +{ > + mp->m_attr_magicpct = (mp->m_sb.sb_blocksize * 37) / 100; > + if (xfs_sb_version_hasunicode(&mp->m_sb)) { > + mp->m_attrnameops = (mp->m_flags & XFS_MOUNT_CI_ATTR) ? > + &xfs_unicode_ci_nameops : &xfs_unicode_nameops; > + } else > + mp->m_attrnameops = &xfs_default_nameops; > +} Hm, I thought most little mount-helper subroutines went right in next to xfs_mountfs() in xfs_mount.c; just a thought. Then you wouldn't need the prototype in the header either... > + > int > xfs_attr_fetch(xfs_inode_t *ip, const char *name, int namelen, > char *value, int *valuelenp, int flags, struct cred *cred) > @@ -122,14 +133,14 @@ xfs_attr_fetch(xfs_inode_t *ip, const ch > * Fill in the arg structure for this request. > */ > memset((char *)&args, 0, sizeof(args)); > - args.name = name; > - args.namelen = namelen; > args.value = value; > args.valuelen = *valuelenp; > args.flags = flags; > - args.hashval = xfs_da_hashname(args.name, args.namelen); > args.dp = ip; > args.whichfork = XFS_ATTR_FORK; > + error = xfs_da_setup_name_and_hash(&args, name, namelen); > + if (error) > + return error; In the spirit of incremental-but-functional patches, which helps to break down & review big patchsets like this, I think this addition of xfs_da_setup_name_and_hash() could stand on its own, and add the nls stuff in a subsequent patch? > /* > * Decide on what work routines to call based on the inode size. > @@ -153,6 +164,7 @@ xfs_attr_fetch(xfs_inode_t *ip, const ch > > if (error == EEXIST) > error = 0; > + xfs_da_cleanup_name(&args, name); I'm being a little lazy here; under which circumstances would args->name != name, and need to be freed? ... > =========================================================================== > fs/xfs/xfs_attr_leaf.c > =========================================================================== > > --- a/fs/xfs/xfs_attr_leaf.c 2008-01-18 15:31:24.000000000 +1100 > +++ b/fs/xfs/xfs_attr_leaf.c 2008-01-18 13:25:11.873394723 +1100 > @@ -42,6 +42,7 @@ > #include "xfs_attr.h" > #include "xfs_attr_leaf.h" > #include "xfs_error.h" > +#include "xfs_unicode.h" > > /* > * xfs_attr_leaf.c > @@ -90,6 +91,10 @@ STATIC void xfs_attr_leaf_moveents(xfs_a > xfs_mount_t *mp); > STATIC int xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index); > > +STATIC int xfs_attr_put_listent(xfs_attr_list_context_t *context, > + attrnames_t *namesp, char *name, > + int namelen, int valuelen, char *value); > + > /*======================================================================== > * Namespace helper routines > *========================================================================*/ > @@ -135,6 +140,38 @@ xfs_attr_namesp_match_overrides(int arg_ > * External routines when attribute fork size < XFS_LITINO(mp). > *========================================================================*/ > > +STATIC xfs_attr_sf_entry_t * > +xfs_attr_shortform_find_ent(xfs_da_args_t *args) > +{ > + xfs_attr_shortform_t *sf; > + xfs_attr_sf_entry_t *sfe; > + int i; > + xfs_attr_sf_entry_t *ci_sfe = NULL; > + > + ASSERT(args->dp->i_afp->if_flags & XFS_IFINLINE); > + sf = (xfs_attr_shortform_t *)args->dp->i_afp->if_u1.if_data; > + sfe = &sf->list[0]; > + > + args->cmpresult = XFS_CMP_DIFFERENT; > + for (i = 0; i < sf->hdr.count; sfe = XFS_ATTR_SF_NEXTENTRY(sfe), i++) { > + if (!xfs_attr_namesp_match(args->flags, sfe->flags)) > + continue; > + switch (xfs_attr_compname(args->dp, sfe->nameval, sfe->namelen, > + args->name, args->namelen)) { > + case XFS_CMP_EXACT: > + args->cmpresult = XFS_CMP_EXACT; > + return sfe; > + case XFS_CMP_CASE: > + if (!ci_sfe) { > + args->cmpresult = XFS_CMP_CASE; > + ci_sfe = sfe; > + } > + default:; > + } > + } > + return ci_sfe; > +} Perhaps this helper could be a sub-patch too? Just a thought. > /* > * Query whether the requested number of additional bytes of extended > * attribute space will be able to fit inline. > @@ -295,13 +332,10 @@ xfs_attr_shortform_add(xfs_da_args_t *ar > sfe = &sf->list[0]; > for (i = 0; i < sf->hdr.count; sfe = XFS_ATTR_SF_NEXTENTRY(sfe), i++) { > #ifdef DEBUG > - if (sfe->namelen != args->namelen) > - continue; > - if (memcmp(args->name, sfe->nameval, args->namelen) != 0) > - continue; > if (!xfs_attr_namesp_match(args->flags, sfe->flags)) > continue; > - ASSERT(0); > + ASSERT(xfs_attr_compname(args->dp, args->name, args->namelen, > + sfe->nameval, sfe->namelen) == XFS_CMP_DIFFERENT); Perhaps this helper too could come as a subpatch. ... > + if (!sfe) > + return XFS_ERROR(ENOATTR); > + Indentation from here on looks busted. Are you missing braces? > if (args->flags & ATTR_KERNOVAL) { > args->valuelen = sfe->valuelen; > - return(XFS_ERROR(EEXIST)); > + return XFS_ERROR(EEXIST); need another tab here? > } > if (args->valuelen < sfe->valuelen) { > args->valuelen = sfe->valuelen; > - return(XFS_ERROR(ERANGE)); > + return XFS_ERROR(ERANGE); and here? > } > args->valuelen = sfe->valuelen; > - memcpy(args->value, &sfe->nameval[args->namelen], > - args->valuelen); > - return(XFS_ERROR(EEXIST)); > - } > - return(XFS_ERROR(ENOATTR)); > + memcpy(args->value, &sfe->nameval[args->namelen], args->valuelen); > + > + return XFS_ERROR(EEXIST); > } > > /* ... > @@ -631,7 +626,7 @@ xfs_attr_shortform_list(xfs_attr_list_co > continue; > } > namesp = xfs_attr_flags_namesp(sfe->flags); > - error = context->put_listent(context, > + error = xfs_attr_put_listent(context, > namesp, > (char *)sfe->nameval, > (int)sfe->namelen, > @@ -734,7 +729,7 @@ xfs_attr_shortform_list(xfs_attr_list_co > cursor->hashval = sbp->hash; > cursor->offset = 0; > } > - error = context->put_listent(context, > + error = xfs_attr_put_listent(context, > namesp, > sbp->name, > sbp->namelen, maybe the introduction of xfs_attr_put_listent could be a small prep-work patch too. Or is this getting old ;) > @@ -1960,6 +1955,7 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp > xfs_attr_leaf_name_remote_t *name_rmt; > int probe, span; > xfs_dahash_t hashval; > + xfs_dacmp_t cmp; > > leaf = bp->data; > ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC); > @@ -2008,6 +2004,7 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp > /* > * Duplicate keys may be present, so search all of them for a match. > */ > + args->cmpresult = XFS_CMP_DIFFERENT; > for ( ; (probe < be16_to_cpu(leaf->hdr.count)) && > (be32_to_cpu(entry->hashval) == hashval); > entry++, probe++) { > @@ -2019,35 +2016,40 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp > * If we are looking for complete entries, show only those. > */ > if ((args->flags & XFS_ATTR_INCOMPLETE) != > - (entry->flags & XFS_ATTR_INCOMPLETE)) { > - continue; > - } > - if (entry->flags & XFS_ATTR_LOCAL) { > - name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, probe); > - if (name_loc->namelen != args->namelen) > - continue; > - if (memcmp(args->name, (char *)name_loc->nameval, args->namelen) != 0) > + (entry->flags & XFS_ATTR_INCOMPLETE)) > continue; > if (!xfs_attr_namesp_match(args->flags, entry->flags)) > continue; > + if (entry->flags & XFS_ATTR_LOCAL) { > + name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, probe); > + cmp = xfs_attr_compname(args->dp, args->name, args->namelen, > + name_loc->nameval, name_loc->namelen); > + if (cmp != XFS_CMP_DIFFERENT && cmp != args->cmpresult) { > + args->cmpresult = cmp; > args->index = probe; weird indentation here too... > - return(XFS_ERROR(EEXIST)); > + args->rmtblkno = 0; > + args->rmtblkcnt = 0; > + if (cmp == XFS_CMP_EXACT) > + return XFS_ERROR(EEXIST); > + } > } else { > name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, probe); > - if (name_rmt->namelen != args->namelen) > - continue; > - if (memcmp(args->name, (char *)name_rmt->name, > - args->namelen) != 0) > - continue; > - if (!xfs_attr_namesp_match(args->flags, entry->flags)) > - continue; > + cmp = xfs_attr_compname(args->dp, args->name, args->namelen, > + name_rmt->name, name_rmt->namelen); > + if (cmp != XFS_CMP_DIFFERENT && cmp != args->cmpresult) { > + args->cmpresult = cmp; > args->index = probe; > args->rmtblkno = be32_to_cpu(name_rmt->valueblk); > args->rmtblkcnt = XFS_B_TO_FSB(args->dp->i_mount, > be32_to_cpu(name_rmt->valuelen)); > - return(XFS_ERROR(EEXIST)); > + if (cmp == XFS_CMP_EXACT) > + return XFS_ERROR(EEXIST); and here > + } > } > } > + if (args->cmpresult == XFS_CMP_CASE) > + return XFS_ERROR(EEXIST); > + > args->index = probe; > return(XFS_ERROR(ENOATTR)); > } > @@ -2418,7 +2420,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, > xfs_attr_leaf_name_local_t *name_loc = > XFS_ATTR_LEAF_NAME_LOCAL(leaf, i); > > - retval = context->put_listent(context, > + retval = xfs_attr_put_listent(context, sub-patch? :) ... (int)name_rmt->namelen, > @@ -2472,6 +2474,31 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, > return(retval); > } > > +/* > + * Do NLS name conversion if required for attribute name and call > + * context's put_listent routine > + */ > + > +STATIC int > +xfs_attr_put_listent(xfs_attr_list_context_t *context, attrnames_t *namesp, > + char *name, int namelen, int valuelen, char *value) > +{ > + xfs_mount_t *mp = context->dp->i_mount; > + char *nls_name = NULL; > + int rval; > + > + if (!mp->m_nls) > + return context->put_listent(context, namesp, name, namelen, > + valuelen, value); > + > + rval = xfs_unicode_to_nls(mp->m_nls, name, namelen, &nls_name); > + if (rval < 0) > + return -rval; > + rval = context->put_listent(context, namesp, nls_name, rval, > + valuelen, value); > + xfs_free_unicode_nls_name(nls_name); > + return rval; > +} > > /*======================================================================== > * Manage the INCOMPLETE flag in a leaf entry > =========================================================================== > fs/xfs/xfs_attr_leaf.h > =========================================================================== > > --- a/fs/xfs/xfs_attr_leaf.h 2008-01-18 15:31:24.000000000 +1100 > +++ b/fs/xfs/xfs_attr_leaf.h 2008-01-11 14:16:44.268796245 +1100 > @@ -36,6 +36,7 @@ struct xfs_da_args; > struct xfs_da_state; > struct xfs_da_state_blk; > struct xfs_inode; > +struct xfs_mount; > struct xfs_trans; > > /*======================================================================== > @@ -204,6 +205,16 @@ static inline int xfs_attr_leaf_entsize_ > return (((bsize) >> 1) + ((bsize) >> 2)); > } > > +/* > + * Do hash and name compare based on nameops > + */ > +#define xfs_attr_hashname(dp, n, l) \ > + ((dp)->i_mount->m_attrnameops->hashname((dp), (n), (l))) > + > +#define xfs_attr_compname(dp, n1, l1, n2, l2) \ > + ((dp)->i_mount->m_attrnameops->compname((dp), (n1), (l1), \ > + (n2), (l2))) > + > > /*======================================================================== > * Structure used to pass context around among the routines. > @@ -296,6 +307,7 @@ int xfs_attr_root_inactive(struct xfs_tr > /* > * Utility routines. > */ > +void xfs_attr_mount(struct xfs_mount *mp); this could just go in xfs_mount.c and be static. > xfs_dahash_t xfs_attr_leaf_lasthash(struct xfs_dabuf *bp, int *count); > int xfs_attr_leaf_order(struct xfs_dabuf *leaf1_bp, > struct xfs_dabuf *leaf2_bp); > > =========================================================================== > fs/xfs/xfs_da_btree.c > =========================================================================== > > --- a/fs/xfs/xfs_da_btree.c 2008-01-18 15:31:24.000000000 +1100 > +++ b/fs/xfs/xfs_da_btree.c 2007-10-31 16:04:16.463309546 +1100 > @@ -46,6 +46,7 @@ > #include "xfs_dir2_block.h" > #include "xfs_dir2_node.h" > #include "xfs_error.h" > +#include "xfs_unicode.h" > > /* > * xfs_da_btree.c > @@ -1530,6 +1531,100 @@ xfs_da_hashname(const uchar_t *name, int > } > } > > + > +static xfs_dahash_t > +xfs_default_hashname(xfs_inode_t *inode, const uchar_t *name, int namelen) > +{ > + return xfs_da_hashname(name, namelen); > +} Could these be rolled into one instead of the wrapper? I see 3 other direct callers of xfs_da_hashname... and does xfs_attr_shortform_list need to use xfs_attr_hashname instead of xfs_da_hashname? Do "." and ".." ever have different answers in different codepages? Does that matter? > +xfs_dacmp_t > +xfs_default_compname(xfs_inode_t *inode, const uchar_t *name1, int len1, > + const uchar_t *name2, int len2) > +{ > + return (len1 == len2 && memcmp(name1, name2, len1) == 0) ? > + XFS_CMP_EXACT : XFS_CMP_DIFFERENT; > +} > + > +static xfs_dahash_t > +xfs_unicode_ci_hashname( > + xfs_inode_t *inode, > + const uchar_t *name, > + int namelen) > +{ > + return xfs_unicode_hash(inode->i_mount->m_cft, name, namelen); > +} this wrapper is the only caller of xfs_unicode_hash? Is it just to conveniently get from inode to m_cft? strikes me as a little interesting that while an inode is passed into a xfs_hashname_t, it's never actually used directly - same for compname - would it make any sense to just pass the xfs_cft in from the start? ... > =========================================================================== > fs/xfs/xfs_dir2.c > =========================================================================== > > --- a/fs/xfs/xfs_dir2.c 2008-01-18 15:31:24.000000000 +1100 > +++ b/fs/xfs/xfs_dir2.c 2008-01-11 14:24:51.701973714 +1100 > @@ -42,8 +42,56 @@ > #include "xfs_dir2_node.h" > #include "xfs_dir2_trace.h" > #include "xfs_error.h" > +#include "xfs_unicode.h" > #include "xfs_vnodeops.h" > > +/* > + * V1 case-insensitive support for directories > + */ remind me, what's "V1?" > +static xfs_dahash_t > +xfs_ascii_ci_hashname( > + xfs_inode_t *inode, > + const uchar_t *name, > + int namelen) > +{ > + xfs_dahash_t hash; > + int i; > + > + for (i = 0, hash = 0; i < namelen; i++) > + hash = tolower(name[i]) ^ rol32(hash, 7); > + > + return hash; > +} > + > +static xfs_dacmp_t > +xfs_ascii_ci_compname( > + xfs_inode_t *inode, > + const uchar_t *name1, > + int len1, > + const uchar_t *name2, > + int len2) > +{ > + xfs_dacmp_t result = XFS_CMP_EXACT; > + int i; > + > + if (len1 != len2) > + return XFS_CMP_DIFFERENT; > + > + for (i = 0; i < len1; i++) { > + if (name1[i] == name2[i]) > + continue; > + if (tolower(name1[i]) != tolower(name2[i])) > + return XFS_CMP_DIFFERENT; > + result = XFS_CMP_CASE; > + } > + > + return result; > +} > + > +static const struct xfs_nameops xfs_ascii_ci_nameops = { > + .hashname = xfs_ascii_ci_hashname, > + .compname = xfs_ascii_ci_compname, > +}; > > void > xfs_dir_mount( > @@ -64,6 +112,13 @@ xfs_dir_mount( > (mp->m_dirblksize - (uint)sizeof(xfs_da_node_hdr_t)) / > (uint)sizeof(xfs_da_node_entry_t); > mp->m_dir_magicpct = (mp->m_dirblksize * 37) / 100; > + > + if (xfs_sb_version_hasunicode(&mp->m_sb)) { > + mp->m_dirnameops = (mp->m_flags & XFS_MOUNT_CI_LOOKUP) ? > + &xfs_unicode_ci_nameops : &xfs_unicode_nameops; > + } else > + mp->m_dirnameops = (xfs_sb_version_hasoldci(&mp->m_sb)) ? > + &xfs_ascii_ci_nameops : &xfs_default_nameops; Oh, "V1" is oldci - can you document it that way in the comment? And if that hasn't been seen in the wild on linux can this go away? ... > =========================================================================== > fs/xfs/xfs_dir2_block.c > =========================================================================== > > --- a/fs/xfs/xfs_dir2_block.c 2008-01-18 15:31:24.000000000 +1100 > +++ b/fs/xfs/xfs_dir2_block.c 2008-01-11 14:28:44.763934272 +1100 ... > @@ -697,20 +720,34 @@ xfs_dir2_block_lookup_int( > dep = (xfs_dir2_data_entry_t *) > ((char *)block + xfs_dir2_dataptr_to_off(mp, addr)); > /* > - * Compare, if it's right give back buffer & entry number. > - */ > - if (dep->namelen == args->namelen && > - dep->name[0] == args->name[0] && > - memcmp(dep->name, args->name, args->namelen) == 0) { > + * Compare, if it's right give back buffer & entry number: > + * > + * lookup case - use nameops; > + * > + * replace/remove case - as lookup has been already been > + * performed, look for an exact match using the fast method > + */ > + cmp = args->oknoent ? > + xfs_dir_compname(dp, dep->name, dep->namelen, > + args->name, args->namelen) : > + xfs_default_compname(dp, dep->name, dep->namelen, > + args->name, args->namelen); > + if (cmp != XFS_CMP_DIFFERENT && cmp != args->cmpresult) { > + args->cmpresult = cmp; > *bpp = bp; > *entno = mid; > + if (cmp == XFS_CMP_EXACT) > return 0; > } > - } while (++mid < be32_to_cpu(btp->count) && be32_to_cpu(blp[mid].hashval) == hash); > + } while (++mid < be32_to_cpu(btp->count) && > + be32_to_cpu(blp[mid].hashval) == hash); thanks... can you trim down the other > 80 char lines you've added, too? :) > @@ -1300,10 +1313,17 @@ xfs_dir2_leaf_lookup( > /* > * Return the found inode number. > */ > + error = EEXIST; > args->inumber = be64_to_cpu(dep->inumber); > + if (args->cmpresult == XFS_CMP_CASE) { > + args->valuelen = xfs_unicode_to_nls(args->dp->i_mount->m_nls, > + dep->name, dep->namelen, (char **)&args->value); > + if (args->valuelen < 0) > + error = -args->valuelen; hm, error signs... new functions return negative, whereas old xfs code returns positive errors? ... > @@ -1391,19 +1413,31 @@ xfs_dir2_leaf_lookup_int( > xfs_dir2_dataptr_to_off(mp, be32_to_cpu(lep->address))); > /* > * If it matches then return it. > - */ > - if (dep->namelen == args->namelen && > - dep->name[0] == args->name[0] && > - memcmp(dep->name, args->name, args->namelen) == 0) { > + * > + * lookup case - use nameops; > + * > + * replace/remove case - as lookup has been already been > + * performed, look for an exact match using the fast method > + */ > + cmp = args->oknoent ? > + xfs_dir_compname(dp, dep->name, dep->namelen, > + args->name, args->namelen) : > + xfs_default_compname(dp, dep->name, dep->namelen, > + args->name, args->namelen); > + if (cmp != XFS_CMP_DIFFERENT && cmp != args->cmpresult) { > + args->cmpresult = cmp; > *dbpp = dbp; > *indexp = index; > + if (cmp == XFS_CMP_EXACT) > return 0; tab missing? > =========================================================================== > fs/xfs/xfs_dir2_node.c > =========================================================================== > > --- a/fs/xfs/xfs_dir2_node.c 2008-01-18 15:31:25.000000000 +1100 > +++ b/fs/xfs/xfs_dir2_node.c 2007-10-31 12:32:04.060201390 +1100 ... > @@ -572,28 +575,34 @@ xfs_dir2_leafn_lookup_int( > /* > * Point to the data entry. > */ > - dep = (xfs_dir2_data_entry_t *) > - ((char *)curbp->data + > + dep = (xfs_dir2_data_entry_t *)((char *)curbp->data + > xfs_dir2_dataptr_to_off(mp, be32_to_cpu(lep->address))); > /* > * Compare the entry, return it if it matches. > */ > - if (dep->namelen == args->namelen && > - dep->name[0] == args->name[0] && > - memcmp(dep->name, args->name, args->namelen) == 0) { > + cmp = args->oknoent ? > + xfs_dir_compname(dp, dep->name, dep->namelen, > + args->name, args->namelen): > + xfs_default_compname(dp, dep->name, dep->namelen, > + args->name, args->namelen); > + if (cmp != XFS_CMP_DIFFERENT && > + cmp != args->cmpresult) { > + args->cmpresult = cmp; > args->inumber = be64_to_cpu(dep->inumber); > *indexp = index; > state->extravalid = 1; > state->extrablk.bp = curbp; > state->extrablk.blkno = curdb; > - state->extrablk.index = > - (int)((char *)dep - > + state->extrablk.index = (int)((char *)dep - > (char *)curbp->data); > state->extrablk.magic = XFS_DIR2_DATA_MAGIC; > + if (cmp == XFS_CMP_EXACT) > return XFS_ERROR(EEXIST); tab... Hmm wonder if I caught all of these... > =========================================================================== > fs/xfs/xfs_dir2_sf.c > =========================================================================== > > --- a/fs/xfs/xfs_dir2_sf.c 2008-01-18 15:31:25.000000000 +1100 > +++ b/fs/xfs/xfs_dir2_sf.c 2008-01-17 12:25:01.552398622 +1100 > @@ -38,6 +38,7 @@ > #include "xfs_dir2_leaf.h" > #include "xfs_dir2_block.h" > #include "xfs_dir2_trace.h" > +#include "xfs_unicode.h" > > /* > * Prototypes for internal functions. > @@ -708,6 +709,8 @@ xfs_dir2_sf_getdents( > xfs_dir2_dataptr_t dot_offset; > xfs_dir2_dataptr_t dotdot_offset; > xfs_ino_t ino; > + char *nls_name = NULL; /* NLS name buffer */ > + int nls_namelen = 0; > > mp = dp->i_mount; > > @@ -772,6 +775,9 @@ xfs_dir2_sf_getdents( > } > } > > + if (mp->m_nls) > + nls_name = xfs_alloc_unicode_nls_name(); > + > /* > * Loop while there are more entries and put'ing works. > */ > @@ -789,16 +795,22 @@ xfs_dir2_sf_getdents( > #if XFS_BIG_INUMS > ino += mp->m_inoadd; > #endif > - > - if (filldir(dirent, sfep->name, sfep->namelen, > + if (mp->m_nls) > + nls_namelen = xfs_unicode_to_nls(mp->m_nls, sfep->name, > + sfep->namelen, &nls_name); > + if (filldir(dirent, > + nls_namelen > 0 ? nls_name : (char *)sfep->name, > + nls_namelen > 0 ? nls_namelen : sfep->namelen, > off, ino, DT_UNKNOWN)) { Hmm we've seen the foo > 0 ? bar : baz stuff a few times, should this get a helper? ... > @@ -844,23 +857,43 @@ xfs_dir2_sf_lookup( > if (args->namelen == 2 && > args->name[0] == '.' && args->name[1] == '.') { > args->inumber = xfs_dir2_sf_get_inumber(sfp, &sfp->hdr.parent); > + args->cmpresult = XFS_CMP_EXACT; > return XFS_ERROR(EEXIST); > } > /* > * Loop over all the entries trying to match ours. > */ > - for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp); > - i < sfp->hdr.count; > + args->cmpresult = XFS_CMP_DIFFERENT; > + for (i = 0, sfep = xfs_dir2_sf_firstentry(sfp); i < sfp->hdr.count; > i++, sfep = xfs_dir2_sf_nextentry(sfp, sfep)) { > - if (sfep->namelen == args->namelen && > - sfep->name[0] == args->name[0] && > - memcmp(args->name, sfep->name, args->namelen) == 0) { > - args->inumber = > - xfs_dir2_sf_get_inumber(sfp, > + switch (xfs_dir_compname(dp, sfep->name, sfep->namelen, > + args->name, args->namelen)) { > + case XFS_CMP_EXACT: > + args->cmpresult = XFS_CMP_EXACT; > + args->inumber = xfs_dir2_sf_get_inumber(sfp, > xfs_dir2_sf_inumberp(sfep)); > + if (args->value) { > + xfs_free_unicode_nls_name(args->value); > + args->value = NULL; > + } > return XFS_ERROR(EEXIST); > + > + case XFS_CMP_CASE: > + if (!args->value) { > + args->valuelen = xfs_unicode_to_nls( > + args->dp->i_mount->m_nls, sfep->name, > + sfep->namelen, (char **)&args->value); > + if (args->valuelen < 0) > + return XFS_ERROR(-args->valuelen); > + args->cmpresult = XFS_CMP_CASE; > + args->inumber = xfs_dir2_sf_get_inumber(sfp, > + xfs_dir2_sf_inumberp(sfep)); > + } > + default: ; Hmm that's a little funky, to my eyes anyway. ... > =========================================================================== > fs/xfs/xfs_mount.c > =========================================================================== > > --- a/fs/xfs/xfs_mount.c 2008-01-18 15:31:25.000000000 +1100 > +++ b/fs/xfs/xfs_mount.c 2008-01-17 17:10:29.777728874 +1100 > @@ -25,6 +25,7 @@ > #include "xfs_sb.h" > #include "xfs_ag.h" > #include "xfs_dir2.h" > +#include "xfs_attr.h" > #include "xfs_dmapi.h" > #include "xfs_mount.h" > #include "xfs_bmap_btree.h" > @@ -43,6 +44,9 @@ > #include "xfs_rw.h" > #include "xfs_quota.h" > #include "xfs_fsops.h" > +#include "xfs_da_btree.h" > +#include "xfs_attr_leaf.h" > +#include "xfs_unicode.h" > > STATIC void xfs_mount_log_sbunit(xfs_mount_t *, __int64_t); > STATIC int xfs_uuid_mount(xfs_mount_t *); > @@ -119,6 +123,8 @@ static const struct { > { offsetof(xfs_sb_t, sb_logsectsize),0 }, > { offsetof(xfs_sb_t, sb_logsunit), 0 }, > { offsetof(xfs_sb_t, sb_features2), 0 }, > + { offsetof(xfs_sb_t, sb_bad_features2), 0 }, bad_features2? what's this and what does it have to do w/ CI, and why is it set but never used in xfs_sb_from_disk? if features2 "could be here" shouldn't we be doing something with that? This could do with comments at least, somewhere. ... > @@ -1165,6 +1176,17 @@ xfs_mountfs( > } > > /* > + * Load in unicode case folding table from disk > + */ > + if (xfs_sb_version_hasunicode(&mp->m_sb)) { > + error = xfs_unicode_read_cft(mp); > + if (error) { > + cmn_err(CE_WARN, "XFS: failed to read case folding table"); 80+ chars... .. > =========================================================================== > fs/xfs/xfs_sb.h > =========================================================================== > > --- a/fs/xfs/xfs_sb.h 2008-01-18 15:31:25.000000000 +1100 > +++ b/fs/xfs/xfs_sb.h 2007-10-23 16:55:47.440178601 +1000 > @@ -46,10 +46,12 @@ struct xfs_mount; > #define XFS_SB_VERSION_SECTORBIT 0x0800 > #define XFS_SB_VERSION_EXTFLGBIT 0x1000 > #define XFS_SB_VERSION_DIRV2BIT 0x2000 > +#define XFS_SB_VERSION_OLDCIBIT 0x4000 > #define XFS_SB_VERSION_MOREBITSBIT 0x8000 > #define XFS_SB_VERSION_OKSASHFBITS \ > (XFS_SB_VERSION_EXTFLGBIT | \ > - XFS_SB_VERSION_DIRV2BIT) > + XFS_SB_VERSION_DIRV2BIT | \ > + XFS_SB_VERSION_OLDCIBIT) there's that oldcibit again... > #define XFS_SB_VERSION_OKREALFBITS \ > (XFS_SB_VERSION_ATTRBIT | \ > XFS_SB_VERSION_NLINKBIT | \ > @@ -77,10 +79,12 @@ struct xfs_mount; > #define XFS_SB_VERSION2_LAZYSBCOUNTBIT 0x00000002 /* Superblk counters */ > #define XFS_SB_VERSION2_RESERVED4BIT 0x00000004 > #define XFS_SB_VERSION2_ATTR2BIT 0x00000008 /* Inline attr rework */ > +#define XFS_SB_VERSION2_UNICODEBIT 0x00000020 /* Unicode names */ > > #define XFS_SB_VERSION2_OKREALFBITS \ > (XFS_SB_VERSION2_LAZYSBCOUNTBIT | \ > - XFS_SB_VERSION2_ATTR2BIT) > + XFS_SB_VERSION2_ATTR2BIT | \ > + XFS_SB_VERSION2_UNICODEBIT) > #define XFS_SB_VERSION2_OKSASHFBITS \ > (0) > #define XFS_SB_VERSION2_OKREALBITS \ > @@ -145,6 +149,9 @@ typedef struct xfs_sb { > __uint16_t sb_logsectsize; /* sector size for the log, bytes */ > __uint32_t sb_logsunit; /* stripe unit size for the log */ > __uint32_t sb_features2; /* additional feature bits */ > + __uint32_t sb_bad_features2; /* features2 could be here */ Ok, so...? ... > @@ -463,6 +475,12 @@ static inline int xfs_sb_version_hassect > ((sbp)->sb_versionnum & XFS_SB_VERSION_SECTORBIT); > } > > +static inline int xfs_sb_version_hasoldci(xfs_sb_t *sbp) > +{ > + return (XFS_SB_VERSION_NUM(sbp) == XFS_SB_VERSION_4) && \ > + ((sbp)->sb_versionnum & XFS_SB_VERSION_OLDCIBIT); > +} You forgot the uppercase indirection macro! ;) ... > =========================================================================== > fs/xfs/xfs_unicode.c > =========================================================================== ... > + > +char * > +xfs_alloc_unicode_nls_name(void) > +{ > + return kmem_zone_alloc(xfs_nls_uni_zone, KM_SLEEP); > +} Why wrap/hide this? > + > + > +void > +xfs_free_unicode_nls_name( > + char *name) > +{ > + kmem_zone_free(xfs_nls_uni_zone, name); > +} Or this? Eh, maybe it's handy. > +int > +xfs_nls_to_unicode( > + struct nls_table *nls, > + const char *nls_name, > + int nls_namelen, > + char **uni_name) > +{ > + char *n; > + int i, o; > + wchar_t uc; > + int nlen; > + int u8len; > + int rval; > + > + n = *uni_name ? *uni_name : xfs_alloc_unicode_nls_name(); > + > + if (!nls) { > + if (nls_namelen > MAXNAMELEN) { > + rval = -ENAMETOOLONG; The rest of core xfs code returns positive errors; why the shift in this file? Well, I guess because you want to return a length, but this strikes me as a bit inconsistent... we've been burned by getting error signs wrong in the past, this looks like an exception to the existing sign conventions ... > +int > +xfs_unicode_validate( > + const uchar_t *name, > + int namelen) > +{ > + wchar_t uc; > + int i, nlen; > + > + for (i = 0; i < namelen; i += nlen) { > + if (*name >= 0xf0) { > + cmn_err(CE_WARN, "xfs_unicode_validate: " > + "UTF-8 char beyond U+FFFF\n"); > + return -EINVAL; > + } > + /* utf8_mbtowc must fail on overlong sequences too */ > + nlen = utf8_mbtowc(&uc, name + i, namelen - i); > + if (nlen < 0) { > + cmn_err(CE_WARN, "xfs_unicode_validate: " > + "invalid UTF-8 sequence\n"); > + return -EILSEQ; > + } > + /* check for invalid/surrogate/private unicode chars */ > + if (uc >= 0xfffe || (uc >= 0xd800 && uc <= 0xf8ff)) { > + cmn_err(CE_WARN, "xfs_unicode_validate: " > + "unsupported UTF-8 char\n"); > + return -EINVAL; > + } > + } > + return 0; > +} and now this leads to stuff like: rval = xfs_unicode_validate(name, namelen); if (rval < 0) return -rval; ... this looks odd to me. ... > +xfs_unicode_read_cft( > + xfs_mount_t *mp) > +{ > + int error; > + xfs_inode_t *cftip; > + int size; > + int nfsb; > + int nmap; > + xfs_bmbt_irec_t *mapp; > + int n; > + int byte_cnt; > + xfs_buf_t *bp; > + char *table; > + xfs_dcft_t *dcft; > + > + if (mp->m_sb.sb_cftino == NULLFSINO || mp->m_sb.sb_cftino == 0) > + return EINVAL; oh, here it's positive? :) ... > +void > +xfs_unicode_free_cft( > + const xfs_cft_t *cft) > +{ > + remove_cft(cft); > +} why the wrapper? > +void > +xfs_unicode_init(void) > +{ > + mutex_init(&cft_lock); > + xfs_nls_uni_zone = kmem_zone_init(MAXNAMELEN, "xfs_nls_uni"); > +} Hm, no corresponding mutex_destroy > +void > +xfs_unicode_uninit(void) > +{ > + int i; > + > + mutex_lock(&cft_lock); > + > + for (i = 0; i < cft_size; i++) { > + ASSERT(cft_list[i].refcount == 0); > + vfree(cft_list[i].table); > + } > + kmem_free(cft_list, cft_size * sizeof(struct cft_item)); > + cft_size = 0; > + cft_list = NULL; > + > + mutex_unlock(&cft_lock); destroy mutex here too just for tidiness > + kmem_zone_destroy(xfs_nls_uni_zone); > +} > ... From owner-xfs@oss.sgi.com Fri Jan 18 21:30:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jan 2008 21:30:37 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0J5UKcj001036 for ; Fri, 18 Jan 2008 21:30:23 -0800 X-ASG-Debug-ID: 1200720639-769101490000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 00F65C9C6B9 for ; Fri, 18 Jan 2008 21:30:39 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id 9oJPxo4kNi43zFxE for ; Fri, 18 Jan 2008 21:30:39 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 9317A18D92255; Fri, 18 Jan 2008 23:30:07 -0600 (CST) Message-ID: <47918ADF.40205@sandeen.net> Date: Fri, 18 Jan 2008 23:30:07 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Barry Naujok CC: "xfs@oss.sgi.com" , xfs-dev X-ASG-Orig-Subj: Re: [REVIEW 1/2] Case insensitive support for XFS - kernel patch Subject: Re: [REVIEW 1/2] Case insensitive support for XFS - kernel patch References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200720640 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39855 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5495/Fri Jan 18 09:03:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14192 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Barry Naujok wrote: > This patch should apply to 2.6.24-rc6. Just FYI, on the stack picture, of the bigger stack users these are the deltas on my x86_64 box: -xfs_bulkstat 280 +xfs_bulkstat 296 :( -xfs_dir2_leaf_getdents 136 +xfs_dir2_leaf_getdents 200 -xfs_dir2_sf_to_block 120 +xfs_dir2_sf_to_block 136 -xfs_dir_canenter 144 +xfs_dir_canenter 152 -xfs_dir_createname 152 +xfs_dir_createname 168 -xfs_dir_lookup 152 +xfs_dir_lookup 168 -xfs_dir_replace 152 +xfs_dir_replace 168 -Eric From owner-xfs@oss.sgi.com Fri Jan 18 21:48:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jan 2008 21:48:58 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0J5mcJb004476 for ; Fri, 18 Jan 2008 21:48:39 -0800 X-ASG-Debug-ID: 1200721736-345f004e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 17490539486 for ; Fri, 18 Jan 2008 21:48:56 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id ZHFICOSzY2opGxMI for ; Fri, 18 Jan 2008 21:48:56 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 2C1D618D92255; Fri, 18 Jan 2008 23:48:55 -0600 (CST) Message-ID: <47918F46.8070600@sandeen.net> Date: Fri, 18 Jan 2008 23:48:54 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Barry Naujok CC: "xfs@oss.sgi.com" , xfs-dev X-ASG-Orig-Subj: Re: [REVIEW 0/2] Case insensitive support for XFS Subject: Re: [REVIEW 0/2] Case insensitive support for XFS References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200721737 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39855 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5495/Fri Jan 18 09:03:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14193 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Barry Naujok wrote: > In the following two emails is contains patches for > case-insensitive and Unicode support for XFS in Linux. > It implements case-insensitivity utilising a Unicode > case folding table stored on disk generated from > http://www.unicode.org/Public/UNIDATA/CaseFolding.txt FWIW, I wanted to play with this a bit, and rolled the patches into Fedora Rawhide rpm builds for kernel & userspace: http://people.fedoraproject.org/~sandeen/xfs-ci/ it's not *in* rawhide; those are scratch builds based on rawhide, with the xfs CI stuff applied. -Eric From owner-xfs@oss.sgi.com Fri Jan 18 22:00:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jan 2008 22:00:41 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0J60ZlB005707 for ; Fri, 18 Jan 2008 22:00:37 -0800 X-ASG-Debug-ID: 1200722454-7f0d03700000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D4D8BC9C60B for ; Fri, 18 Jan 2008 22:00:54 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id alNV448KQ9W27JlH for ; Fri, 18 Jan 2008 22:00:54 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id BA50118D92252; Sat, 19 Jan 2008 00:00:52 -0600 (CST) Message-ID: <47919214.9000807@sandeen.net> Date: Sat, 19 Jan 2008 00:00:52 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Barry Naujok CC: "xfs@oss.sgi.com" , xfs-dev X-ASG-Orig-Subj: Re: [REVIEW 2/2] Case insensitive support for XFS - user-space Subject: Re: [REVIEW 2/2] Case insensitive support for XFS - user-space References: <479118CF.1020302@sandeen.net> In-Reply-To: <479118CF.1020302@sandeen.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200722454 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39856 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5495/Fri Jan 18 09:03:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14194 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Eric Sandeen wrote: > Also, if I specify -nutf8=default on a 500m fs: > > # mkfs.xfs -dfile,name=fsfile,size=500m -nutf8=default > meta-data=fsfile isize=256 agcount=4, agsize=32000 blks > = sectsz=512 attr=2 > data = bsize=4096 blocks=128000, imaxpct=25 > = sunit=0 swidth=0 blks > naming =version 2 bsize=4096 utf8=default > log =internal log bsize=4096 blocks=1200, version=2 > = sectsz=512 sunit=0 blks, lazy-count=0 > realtime =none extsz=4096 blocks=0, rtextents=0 > mkfs.xfs: cannot reserve space: No space left on device /* * allocate the inode */ tp = libxfs_trans_alloc(mp, 0); error = libxfs_trans_reserve(tp, XFS_CREATE_LOG_RES(mp), 0, 0, 0, 0); if (error) { fprintf(stderr, _("%s: 1: cannot reserve space: %s (%d)\n"), progname, strerror(error), XFS_CREATE_LOG_RES(mp)); exit(1); } I think there are some wrong arguments to that trans_reserve... at least XFS_CREATE_LOG_RES should be 3rd arg, no? -Eric From owner-xfs@oss.sgi.com Sat Jan 19 07:53:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 19 Jan 2008 07:54:03 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0JFrTd2019862 for ; Sat, 19 Jan 2008 07:53:34 -0800 X-ASG-Debug-ID: 1200758027-7c8a00540000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sovereign.computergmbh.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C454B53A63B for ; Sat, 19 Jan 2008 07:53:48 -0800 (PST) Received: from sovereign.computergmbh.de (sovereign.computergmbh.de [85.214.69.204]) by cuda.sgi.com with ESMTP id bJk0IJG4mFjoBXSE for ; Sat, 19 Jan 2008 07:53:48 -0800 (PST) Received: by sovereign.computergmbh.de (Postfix, from userid 25121) id 2B2C91802CE22; Sat, 19 Jan 2008 16:53:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by sovereign.computergmbh.de (Postfix) with ESMTP id 231F91C008C9B for ; Sat, 19 Jan 2008 16:53:46 +0100 (CET) Date: Sat, 19 Jan 2008 16:53:46 +0100 (CET) From: Jan Engelhardt To: xfs@oss.sgi.com X-ASG-Orig-Subj: Volume too big Subject: Volume too big Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Barracuda-Connect: sovereign.computergmbh.de[85.214.69.204] X-Barracuda-Start-Time: 1200758028 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39898 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5496/Sat Jan 19 06:19:40 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14195 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jengelh@computergmbh.de Precedence: bulk X-list: xfs Hi, 16:51 localhost:~ # fdisk -l /dev/md0 Disk /dev/md0: 60183.2 GB, 60183225368576 bytes 2 heads, 4 sectors/track, -1 cylinders Units = cylinders of 8 * 512 = 4096 bytes Disk identifier: 0x00000000 Disk /dev/md0 doesn't contain a valid partition table 16:51 localhost:~ # mkfs.xfs -ff /dev/md0 meta-data=/dev/md0 isize=256 agcount=55, agsize=268435455 blks = sectsz=512 attr=0 data = bsize=4096 blocks=14693170256, imaxpct=25 = sunit=0 swidth=0 blks, unwritten=1 naming =version 2 bsize=4096 log =internal log bsize=4096 blocks=32768, version=1 = sectsz=512 sunit=0 blks, lazy-count=0 realtime =none extsz=4096 blocks=0, rtextents=0 16:51 localhost:~ # strace -e mount mount /dev/md0 /mnt mount("/dev/md0", "/mnt", "xfs", MS_MGC_VAL, NULL) = -1 E2BIG (Argument list too long) mount: Argument list too long 16:51 localhost:~ # uname -a Linux localhost 2.6.23.14-ccj63-regular #1 SMP 2007/10/26 14:17:15 UTC i686 athlon i386 GNU/Linux CONFIG_LBD=y. Do I need an extra flag for mkfs? From owner-xfs@oss.sgi.com Sat Jan 19 08:16:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 19 Jan 2008 08:16:21 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0JGGGxY021446 for ; Sat, 19 Jan 2008 08:16:19 -0800 X-ASG-Debug-ID: 1200759395-621300bd0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E745B53A8B5 for ; Sat, 19 Jan 2008 08:16:35 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id eE414Q8hYSQlSWjh for ; Sat, 19 Jan 2008 08:16:35 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 62F6518D92252; Sat, 19 Jan 2008 10:15:59 -0600 (CST) Message-ID: <4792223E.7080805@sandeen.net> Date: Sat, 19 Jan 2008 10:15:58 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Jan Engelhardt CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Volume too big Subject: Re: Volume too big References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200759395 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39898 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5496/Sat Jan 19 06:19:40 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14196 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 Jan Engelhardt wrote: > Hi, > > > > 16:51 localhost:~ # fdisk -l /dev/md0 > > Disk /dev/md0: 60183.2 GB, 60183225368576 bytes > 2 heads, 4 sectors/track, -1 cylinders > Units = cylinders of 8 * 512 = 4096 bytes > Disk identifier: 0x00000000 > > Disk /dev/md0 doesn't contain a valid partition table > > 16:51 localhost:~ # mkfs.xfs -ff /dev/md0 > meta-data=/dev/md0 isize=256 agcount=55, agsize=268435455 blks > = sectsz=512 attr=0 > data = bsize=4096 blocks=14693170256, imaxpct=25 > = sunit=0 swidth=0 blks, unwritten=1 > naming =version 2 bsize=4096 > log =internal log bsize=4096 blocks=32768, version=1 > = sectsz=512 sunit=0 blks, lazy-count=0 > realtime =none extsz=4096 blocks=0, rtextents=0 > > 16:51 localhost:~ # strace -e mount mount /dev/md0 /mnt > mount("/dev/md0", "/mnt", "xfs", MS_MGC_VAL, NULL) = -1 E2BIG (Argument > list too long) > mount: Argument list too long > > 16:51 localhost:~ # uname -a > Linux localhost 2.6.23.14-ccj63-regular #1 SMP 2007/10/26 14:17:15 UTC > i686 athlon i386 GNU/Linux > > CONFIG_LBD=y. Do I need an extra flag for mkfs? Nope; this is probably that you can't do > 16T on a 32 bit box (core linux restriction, pretty much) dmesg would also yield more information about the cause of the mount failure. (Hm, argument list too long is an interesting result tho...) get an x86_64, I think :) -Eric From owner-xfs@oss.sgi.com Sat Jan 19 09:28:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 19 Jan 2008 09:28:56 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0JHSj2r030002 for ; Sat, 19 Jan 2008 09:28:47 -0800 X-ASG-Debug-ID: 1200763744-43d300740000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E280853AA43 for ; Sat, 19 Jan 2008 09:29:04 -0800 (PST) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id SHCR9EFFgFrow4cn for ; Sat, 19 Jan 2008 09:29:04 -0800 (PST) Received: by lucidpixels.com (Postfix, from userid 1001) id D52381C00022A; Sat, 19 Jan 2008 12:29:03 -0500 (EST) Date: Sat, 19 Jan 2008 12:29:03 -0500 (EST) From: Justin Piszcz X-X-Sender: jpiszcz@p34.internal.lan To: Eric Sandeen cc: Jan Engelhardt , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Volume too big Subject: Re: Volume too big In-Reply-To: <4792223E.7080805@sandeen.net> Message-ID: References: <4792223E.7080805@sandeen.net> User-Agent: Alpine 0.999999 (DEB 847 2007-12-06) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1200763744 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39903 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5496/Sat Jan 19 06:19:40 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14197 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Sat, 19 Jan 2008, Eric Sandeen wrote: > Jan Engelhardt wrote: >> Hi, >> >> >> >> 16:51 localhost:~ # fdisk -l /dev/md0 >> >> Disk /dev/md0: 60183.2 GB, 60183225368576 bytes >> 2 heads, 4 sectors/track, -1 cylinders >> Units = cylinders of 8 * 512 = 4096 bytes >> Disk identifier: 0x00000000 >> >> Disk /dev/md0 doesn't contain a valid partition table >> >> 16:51 localhost:~ # mkfs.xfs -ff /dev/md0 >> meta-data=/dev/md0 isize=256 agcount=55, agsize=268435455 blks >> = sectsz=512 attr=0 >> data = bsize=4096 blocks=14693170256, imaxpct=25 >> = sunit=0 swidth=0 blks, unwritten=1 >> naming =version 2 bsize=4096 >> log =internal log bsize=4096 blocks=32768, version=1 >> = sectsz=512 sunit=0 blks, lazy-count=0 >> realtime =none extsz=4096 blocks=0, rtextents=0 >> >> 16:51 localhost:~ # strace -e mount mount /dev/md0 /mnt >> mount("/dev/md0", "/mnt", "xfs", MS_MGC_VAL, NULL) = -1 E2BIG (Argument >> list too long) >> mount: Argument list too long >> >> 16:51 localhost:~ # uname -a >> Linux localhost 2.6.23.14-ccj63-regular #1 SMP 2007/10/26 14:17:15 UTC >> i686 athlon i386 GNU/Linux >> >> CONFIG_LBD=y. Do I need an extra flag for mkfs? > > Nope; this is probably that you can't do > 16T on a 32 bit box (core > linux restriction, pretty much) > > dmesg would also yield more information about the cause of the mount > failure. > > (Hm, argument list too long is an interesting result tho...) > > get an x86_64, I think :) > > -Eric > > Is that on one of those thumper boxes? What type of HW? Justin. From owner-xfs@oss.sgi.com Sat Jan 19 09:53:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 19 Jan 2008 09:53:34 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0JHrTkk031525 for ; Sat, 19 Jan 2008 09:53:29 -0800 X-ASG-Debug-ID: 1200765224-2890001d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sovereign.computergmbh.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 73ED9CA04CC for ; Sat, 19 Jan 2008 09:53:44 -0800 (PST) Received: from sovereign.computergmbh.de (sovereign.computergmbh.de [85.214.69.204]) by cuda.sgi.com with ESMTP id 3BDq2x1U8umHAZv0 for ; Sat, 19 Jan 2008 09:53:44 -0800 (PST) Received: by sovereign.computergmbh.de (Postfix, from userid 25121) id 3DA6C1802CE22; Sat, 19 Jan 2008 18:53:06 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by sovereign.computergmbh.de (Postfix) with ESMTP id 356EA1C008C9B; Sat, 19 Jan 2008 18:53:06 +0100 (CET) Date: Sat, 19 Jan 2008 18:53:06 +0100 (CET) From: Jan Engelhardt To: Eric Sandeen cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Volume too big Subject: Re: Volume too big In-Reply-To: <4792223E.7080805@sandeen.net> Message-ID: References: <4792223E.7080805@sandeen.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Barracuda-Connect: sovereign.computergmbh.de[85.214.69.204] X-Barracuda-Start-Time: 1200765228 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39905 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5496/Sat Jan 19 06:19:40 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14198 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jengelh@computergmbh.de Precedence: bulk X-list: xfs On Jan 19 2008 10:15, Eric Sandeen wrote: >> >> 16:51 localhost:~ # strace -e mount mount /dev/md0 /mnt >> mount("/dev/md0", "/mnt", "xfs", MS_MGC_VAL, NULL) = -1 E2BIG (Argument >> list too long) >> mount: Argument list too long >> >> 16:51 localhost:~ # uname -a >> Linux localhost 2.6.23.14-ccj63-regular #1 SMP 2007/10/26 14:17:15 UTC >> i686 athlon i386 GNU/Linux >> >> CONFIG_LBD=y. Do I need an extra flag for mkfs? > >Nope; this is probably that you can't do > 16T on a 32 bit box (core >linux restriction, pretty much) >get an x86_64, I think :) Hm, JFS fails too. But btrfs 0.11 can mount it. >dmesg would also yield more information about the cause of the mount >failure. XFS: file system too large to be mounted on this system XFS: SB validate fialed >(Hm, argument list too long is an interesting result tho...) I suppose it's right here: #if XFS_BIG_BLKNOS /* Limited by ULONG_MAX of page cache index */ if (nblocks >> (PAGE_CACHE_SHIFT - sbp->sb_blocklog) > ULONG_MAX) return E2BIG; #else /* Limited by UINT_MAX of sectors */ From owner-xfs@oss.sgi.com Sat Jan 19 10:04:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 19 Jan 2008 10:04:07 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0JI40dm032397 for ; Sat, 19 Jan 2008 10:04:04 -0800 X-ASG-Debug-ID: 1200765859-2890003d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sovereign.computergmbh.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 04A65CA0323 for ; Sat, 19 Jan 2008 10:04:19 -0800 (PST) Received: from sovereign.computergmbh.de (sovereign.computergmbh.de [85.214.69.204]) by cuda.sgi.com with ESMTP id S1jmtFcI9HBnUo7H for ; Sat, 19 Jan 2008 10:04:19 -0800 (PST) Received: by sovereign.computergmbh.de (Postfix, from userid 25121) id C04E61802CE22; Sat, 19 Jan 2008 19:04:17 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by sovereign.computergmbh.de (Postfix) with ESMTP id B87E71C008C9B; Sat, 19 Jan 2008 19:04:17 +0100 (CET) Date: Sat, 19 Jan 2008 19:04:17 +0100 (CET) From: Jan Engelhardt To: Justin Piszcz cc: Eric Sandeen , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Volume too big Subject: Re: Volume too big In-Reply-To: Message-ID: References: <4792223E.7080805@sandeen.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Barracuda-Connect: sovereign.computergmbh.de[85.214.69.204] X-Barracuda-Start-Time: 1200765860 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39905 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5496/Sat Jan 19 06:19:40 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14199 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jengelh@computergmbh.de Precedence: bulk X-list: xfs On Jan 19 2008 12:29, Justin Piszcz wrote: >> >> Disk /dev/md0: 60183.2 GB, 60183225368576 bytes > > Is that on one of those thumper boxes? > What type of HW? A bunch of "VMware Virtual SCSI Disk" in sparse mode. From owner-xfs@oss.sgi.com Sat Jan 19 12:12:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 19 Jan 2008 12:12:22 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0JKCHTQ009074 for ; Sat, 19 Jan 2008 12:12:18 -0800 X-ASG-Debug-ID: 1200773553-733501e00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9E518CA09DB for ; Sat, 19 Jan 2008 12:12:33 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id REswos6vQaUKzozC for ; Sat, 19 Jan 2008 12:12:33 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 4EF8218D9227C; Sat, 19 Jan 2008 14:12:01 -0600 (CST) Message-ID: <47925990.7070004@sandeen.net> Date: Sat, 19 Jan 2008 14:12:00 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Jan Engelhardt CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Volume too big Subject: Re: Volume too big References: <4792223E.7080805@sandeen.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200773556 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39915 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5497/Sat Jan 19 09:22:49 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14200 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 Jan Engelhardt wrote: >> (Hm, argument list too long is an interesting result tho...) > > I suppose it's right here: > > #if XFS_BIG_BLKNOS /* Limited by ULONG_MAX of page cache index */ > if (nblocks >> (PAGE_CACHE_SHIFT - sbp->sb_blocklog) > ULONG_MAX) > return E2BIG; > #else /* Limited by UINT_MAX of sectors */ > Yeah, I really think the E2BIGs in xfs should probably be swapped for EFBIG; more helpful error message. -Eric From owner-xfs@oss.sgi.com Sat Jan 19 12:37:06 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 19 Jan 2008 12:37:10 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0JKb0fd015489 for ; Sat, 19 Jan 2008 12:37:06 -0800 X-ASG-Debug-ID: 1200775038-0cd801ae0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 58132CA0B54 for ; Sat, 19 Jan 2008 12:37:18 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id xFDYh2nLaivyC30W for ; Sat, 19 Jan 2008 12:37:18 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 0F43318D9045C for ; Sat, 19 Jan 2008 14:36:45 -0600 (CST) Message-ID: <47925F5C.7010701@sandeen.net> Date: Sat, 19 Jan 2008 14:36:44 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: xfs-oss X-ASG-Orig-Subj: [PATCH] swap E2BIG for EFBIG in mount size checks Subject: [PATCH] swap E2BIG for EFBIG in mount size checks Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200775039 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39917 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5497/Sat Jan 19 09:22:49 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14201 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 Mounting a too-big filesystem results in a very strange "mount: Argument list too long" error message thanks to the use of E2BIG vs. EFBIG. Changing this should make the error message a little more helpful. (Incidentally: why do we check for ENOSPC after a read, and convert it to E[2F]BIG? It seems to be ancient code... And what would you think of making "size check 1 failed" etc something more descriptive, like "Sector count overflows" perhaps?) Signed-off-by: Eric Sandeen --- Index: linux-2.6-xfs/fs/xfs/xfs_mount.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.c +++ linux-2.6-xfs/fs/xfs/xfs_mount.c @@ -196,10 +196,10 @@ xfs_sb_validate_fsb_count( #if XFS_BIG_BLKNOS /* Limited by ULONG_MAX of page cache index */ if (nblocks >> (PAGE_CACHE_SHIFT - sbp->sb_blocklog) > ULONG_MAX) - return E2BIG; + return EFBIG; #else /* Limited by UINT_MAX of sectors */ if (nblocks << (sbp->sb_blocklog - BBSHIFT) > UINT_MAX) - return E2BIG; + return EFBIG; #endif return 0; } @@ -289,7 +289,7 @@ xfs_mount_validate_sb( xfs_sb_validate_fsb_count(sbp, sbp->sb_rblocks)) { xfs_fs_mount_cmn_err(flags, "file system too large to be mounted on this system."); - return XFS_ERROR(E2BIG); + return XFS_ERROR(EFBIG); } if (unlikely(sbp->sb_inprogress)) { @@ -899,7 +899,7 @@ xfs_check_sizes(xfs_mount_t *mp, int mfs d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks); if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_dblocks) { cmn_err(CE_WARN, "XFS: size check 1 failed"); - return XFS_ERROR(E2BIG); + return XFS_ERROR(EFBIG); } error = xfs_read_buf(mp, mp->m_ddev_targp, d - XFS_FSS_TO_BB(mp, 1), @@ -909,7 +909,7 @@ xfs_check_sizes(xfs_mount_t *mp, int mfs } else { cmn_err(CE_WARN, "XFS: size check 2 failed"); if (error == ENOSPC) - error = XFS_ERROR(E2BIG); + error = XFS_ERROR(EFBIG); return error; } @@ -918,7 +918,7 @@ xfs_check_sizes(xfs_mount_t *mp, int mfs d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks); if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks) { cmn_err(CE_WARN, "XFS: size check 3 failed"); - return XFS_ERROR(E2BIG); + return XFS_ERROR(EFBIG); } error = xfs_read_buf(mp, mp->m_logdev_targp, d - XFS_FSB_TO_BB(mp, 1), @@ -928,7 +928,7 @@ xfs_check_sizes(xfs_mount_t *mp, int mfs } else { cmn_err(CE_WARN, "XFS: size check 3 failed"); if (error == ENOSPC) - error = XFS_ERROR(E2BIG); + error = XFS_ERROR(EFBIG); return error; } } Index: linux-2.6-xfs/fs/xfs/xfs_rtalloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_rtalloc.c +++ linux-2.6-xfs/fs/xfs/xfs_rtalloc.c @@ -2236,7 +2236,7 @@ xfs_rtmount_init( cmn_err(CE_WARN, "XFS: realtime mount -- %llu != %llu", (unsigned long long) XFS_BB_TO_FSB(mp, d), (unsigned long long) mp->m_sb.sb_rblocks); - return XFS_ERROR(E2BIG); + return XFS_ERROR(EFBIG); } error = xfs_read_buf(mp, mp->m_rtdev_targp, d - XFS_FSB_TO_BB(mp, 1), @@ -2245,7 +2245,7 @@ xfs_rtmount_init( cmn_err(CE_WARN, "XFS: realtime mount -- xfs_read_buf failed, returned %d", error); if (error == ENOSPC) - return XFS_ERROR(E2BIG); + return XFS_ERROR(EFBIG); return error; } xfs_buf_relse(bp); From owner-xfs@oss.sgi.com Sat Jan 19 12:41:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 19 Jan 2008 12:41:30 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0JKfPsD016139 for ; Sat, 19 Jan 2008 12:41:26 -0800 X-ASG-Debug-ID: 1200775304-6e1c00280000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8044453B039 for ; Sat, 19 Jan 2008 12:41:44 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id a5aPBIushxcBwQzf for ; Sat, 19 Jan 2008 12:41:44 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id B1B2718D9045C; Sat, 19 Jan 2008 14:41:43 -0600 (CST) Message-ID: <47926087.3020600@sandeen.net> Date: Sat, 19 Jan 2008 14:41:43 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Jan Engelhardt CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Volume too big Subject: Re: Volume too big References: <4792223E.7080805@sandeen.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200775304 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39915 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5497/Sat Jan 19 09:22:49 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14202 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 Jan Engelhardt wrote: > On Jan 19 2008 10:15, Eric Sandeen wrote: >>> 16:51 localhost:~ # strace -e mount mount /dev/md0 /mnt >>> mount("/dev/md0", "/mnt", "xfs", MS_MGC_VAL, NULL) = -1 E2BIG (Argument >>> list too long) >>> mount: Argument list too long >>> >>> 16:51 localhost:~ # uname -a >>> Linux localhost 2.6.23.14-ccj63-regular #1 SMP 2007/10/26 14:17:15 UTC >>> i686 athlon i386 GNU/Linux >>> >>> CONFIG_LBD=y. Do I need an extra flag for mkfs? >> Nope; this is probably that you can't do > 16T on a 32 bit box (core >> linux restriction, pretty much) >> get an x86_64, I think :) > > Hm, JFS fails too. > But btrfs 0.11 can mount it. It's possible that btrfs can cope with this somehow - but also quite possible that it's just missing the right checks :) -Eric From owner-xfs@oss.sgi.com Sat Jan 19 13:02:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 19 Jan 2008 13:02:13 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0JL1uBD018260 for ; Sat, 19 Jan 2008 13:02:00 -0800 X-ASG-Debug-ID: 1200776535-1ff401b30000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sovereign.computergmbh.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 21A6ACA0C27 for ; Sat, 19 Jan 2008 13:02:15 -0800 (PST) Received: from sovereign.computergmbh.de (sovereign.computergmbh.de [85.214.69.204]) by cuda.sgi.com with ESMTP id KEme1V7f82i43Y1Z for ; Sat, 19 Jan 2008 13:02:15 -0800 (PST) Received: by sovereign.computergmbh.de (Postfix, from userid 25121) id 8426C180B27C4; Sat, 19 Jan 2008 22:01:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by sovereign.computergmbh.de (Postfix) with ESMTP id 7BE2B1C05DF6D; Sat, 19 Jan 2008 22:01:41 +0100 (CET) Date: Sat, 19 Jan 2008 22:01:41 +0100 (CET) From: Jan Engelhardt To: Eric Sandeen cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Volume too big Subject: Re: Volume too big In-Reply-To: <47926087.3020600@sandeen.net> Message-ID: References: <4792223E.7080805@sandeen.net> <47926087.3020600@sandeen.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Barracuda-Connect: sovereign.computergmbh.de[85.214.69.204] X-Barracuda-Start-Time: 1200776536 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39917 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5497/Sat Jan 19 09:22:49 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14203 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jengelh@computergmbh.de Precedence: bulk X-list: xfs On Jan 19 2008 14:41, Eric Sandeen wrote: >Jan Engelhardt wrote: >> On Jan 19 2008 10:15, Eric Sandeen wrote: >>>> 16:51 localhost:~ # strace -e mount mount /dev/md0 /mnt >>>> mount("/dev/md0", "/mnt", "xfs", MS_MGC_VAL, NULL) = -1 E2BIG (Argument >>>> list too long) >>>> mount: Argument list too long >>>> >>>> 16:51 localhost:~ # uname -a >>>> Linux localhost 2.6.23.14-ccj63-regular #1 SMP 2007/10/26 14:17:15 UTC >>>> i686 athlon i386 GNU/Linux >>>> >>>> CONFIG_LBD=y. Do I need an extra flag for mkfs? >>> Nope; this is probably that you can't do > 16T on a 32 bit box (core >>> linux restriction, pretty much) >>> get an x86_64, I think :) >> >> Hm, JFS fails too. >> But btrfs 0.11 can mount it. > >It's possible that btrfs can cope with this somehow - but also quite >possible that it's just missing the right checks :) > I am not sure why Linux would be limited to 16 TB. If LBD is on, things are 64 bit, so I would expect to have at least access to 2 exabyte. From owner-xfs@oss.sgi.com Sat Jan 19 13:26:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 19 Jan 2008 13:26:49 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_45 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0JLQeX5020758 for ; Sat, 19 Jan 2008 13:26:45 -0800 X-ASG-Debug-ID: 1200778019-0977002b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E388A53B154 for ; Sat, 19 Jan 2008 13:26:59 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id Z7Asb8iBErxigyvL for ; Sat, 19 Jan 2008 13:26:59 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 9D20218D9045B; Sat, 19 Jan 2008 15:26:26 -0600 (CST) Message-ID: <47926B02.709@sandeen.net> Date: Sat, 19 Jan 2008 15:26:26 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Jan Engelhardt CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Volume too big Subject: Re: Volume too big References: <4792223E.7080805@sandeen.net> <47926087.3020600@sandeen.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200778019 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.39919 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5498/Sat Jan 19 12:41:41 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14204 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 Jan Engelhardt wrote: > On Jan 19 2008 14:41, Eric Sandeen wrote: >> It's possible that btrfs can cope with this somehow - but also quite >> possible that it's just missing the right checks :) >> > I am not sure why Linux would be limited to 16 TB. If LBD is on, > things are 64 bit, so I would expect to have at least access to > 2 exabyte. 64-bit sector addressing, but there is a 32-bit index into the (4k) pagecache. 2^32 * 4096 is 16T So an address space has a 16T limit. Even mkfs, if it needs to write past 16T (and I think mkfs.btrfs doesn't need that...) will have trouble, if the device is > 16T - unless mkfs uses direct IO. -Eric From owner-xfs@oss.sgi.com Sun Jan 20 14:04:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 14:04:23 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0KM4IvC006036 for ; Sun, 20 Jan 2008 14:04:20 -0800 X-ASG-Debug-ID: 1200866672-74cc015f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C8EFF53DC75 for ; Sun, 20 Jan 2008 14:04:33 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id 75RPSSNwbmjKlQLm for ; Sun, 20 Jan 2008 14:04:33 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 32D74182DD0B4; Sun, 20 Jan 2008 16:03:58 -0600 (CST) Message-ID: <4793C54D.7060003@sandeen.net> Date: Sun, 20 Jan 2008 16:03:57 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Jan Engelhardt CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Volume too big Subject: Re: Volume too big References: <4792223E.7080805@sandeen.net> <47926087.3020600@sandeen.net> In-Reply-To: <47926087.3020600@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200866677 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40016 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5504/Sun Jan 20 12:29:54 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14205 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Eric Sandeen wrote: > Jan Engelhardt wrote: >> On Jan 19 2008 10:15, Eric Sandeen wrote: >>>> 16:51 localhost:~ # strace -e mount mount /dev/md0 /mnt >>>> mount("/dev/md0", "/mnt", "xfs", MS_MGC_VAL, NULL) = -1 E2BIG (Argument >>>> list too long) >>>> mount: Argument list too long >>>> >>>> 16:51 localhost:~ # uname -a >>>> Linux localhost 2.6.23.14-ccj63-regular #1 SMP 2007/10/26 14:17:15 UTC >>>> i686 athlon i386 GNU/Linux >>>> >>>> CONFIG_LBD=y. Do I need an extra flag for mkfs? >>> Nope; this is probably that you can't do > 16T on a 32 bit box (core >>> linux restriction, pretty much) >>> get an x86_64, I think :) >> Hm, JFS fails too. >> But btrfs 0.11 can mount it. > > It's possible that btrfs can cope with this somehow - but also quite > possible that it's just missing the right checks :) re: btrfs... [15:50] sandeen_: mkfs will work on >16TB, but the limiting factor is the 32 bit radix tree ops on the page cache [15:50] so yes, it is missing a check ;) :) -Eric From owner-xfs@oss.sgi.com Sun Jan 20 14:26:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 14:26:56 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0KMQpt3007852 for ; Sun, 20 Jan 2008 14:26:53 -0800 X-ASG-Debug-ID: 1200868030-7b9101770000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from postoffice.aconex.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 47FB053DDA9 for ; Sun, 20 Jan 2008 14:27:10 -0800 (PST) Received: from postoffice.aconex.com (prod.aconex.com [203.89.192.138]) by cuda.sgi.com with ESMTP id SPOCesKWkCnPAsT4 for ; Sun, 20 Jan 2008 14:27:10 -0800 (PST) Received: from edge.scott.net.au (unknown [203.89.192.141]) by postoffice.aconex.com (Postfix) with ESMTP id 479E892D159; Mon, 21 Jan 2008 09:27:09 +1100 (EST) X-ASG-Orig-Subj: Re: [REVIEW 0/2] Case insensitive support for XFS Subject: Re: [REVIEW 0/2] Case insensitive support for XFS From: Nathan Scott Reply-To: nscott@aconex.com To: Martin Steigerwald Cc: linux-xfs@oss.sgi.com In-Reply-To: <200801181905.05263.Martin@lichtvoll.de> References: (sfid-20080118_105816_866313_50CC6B33) <200801181905.05263.Martin@lichtvoll.de> Content-Type: text/plain Organization: Aconex Date: Mon, 21 Jan 2008 09:30:14 +1100 Message-Id: <1200868214.9463.274.camel@edge.scott.net.au> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: prod.aconex.com[203.89.192.138] X-Barracuda-Start-Time: 1200868031 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40018 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5504/Sun Jan 20 12:29:54 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14206 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: nscott@aconex.com Precedence: bulk X-list: xfs On Fri, 2008-01-18 at 19:05 +0100, Martin Steigerwald wrote: > Hi Barry! > > Am Freitag 18 Januar 2008 schrieb Barry Naujok: > > > There are two mount options for enabling case-insensitivity > > on a Unicode XFS filesystem: > > - "ci" - enables case-insensitivity for file names > > - "ciattr" - enables case-insensitivity for extended > > attributes. > > How do I know that I am on an Unicode XFS filesystem. Could I see this > with xfs_db -r -c 'sb 0' -c p ? Hmm, nothing unicode related in > there as far as I can see. The fs was created with 2.6.23, mkfs.xfs 2.9.4 > and the mkfs options that David suggested. You'd have created it with the magic (new) mkfs option, and the xfs_db "version" command would tell you it was enabled. > Do I need to backup / mkfs / restore to switch to one? I understand that I Yes. > can switch between enable / disable case-insensitivity via a mount > option. No. > Would I be able to enable unicode via xfs_db version command or > something like it? Not as far as I know. It would be more likely implemented as an extension to xfs_repair I think, if it were ever done (the xfs_db version command definately wont have the right kind of logic to enable/disable this). cheers. -- Nathan From owner-xfs@oss.sgi.com Sun Jan 20 16:36:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 16:36:09 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,J_CHICKENPOX_64 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0L0ZvCU020073 for ; Sun, 20 Jan 2008 16:36:04 -0800 X-ASG-Debug-ID: 1200875775-391f01680000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mta5.srv.hcvlny.cv.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A917ACA984E for ; Sun, 20 Jan 2008 16:36:16 -0800 (PST) Received: from mta5.srv.hcvlny.cv.net (mta5.srv.hcvlny.cv.net [167.206.4.200]) by cuda.sgi.com with ESMTP id esgOo5wye9fAI60n for ; Sun, 20 Jan 2008 16:36:16 -0800 (PST) Received: from freyr.home (ool-44c218a8.dyn.optonline.net [68.194.24.168]) by mta5.srv.hcvlny.cv.net (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTP id <0JUY00L7EXOCAB40@mta5.srv.hcvlny.cv.net> for xfs@oss.sgi.com; Sun, 20 Jan 2008 19:36:15 -0500 (EST) Received: by freyr.home (Postfix, from userid 1000) id 32844800ABF; Sun, 20 Jan 2008 19:35:57 -0500 (EST) Date: Sun, 20 Jan 2008 19:35:57 -0500 From: "Josef 'Jeff' Sipek" X-ASG-Orig-Subj: [PATCH 1/1] XFS: Replace custom AIL linked-list code with struct list_head Subject: [PATCH 1/1] XFS: Replace custom AIL linked-list code with struct list_head To: xfs@oss.sgi.com Cc: "Josef 'Jeff' Sipek" Message-id: <1200875757-26598-1-git-send-email-jeffpc@josefsipek.net> X-Mailer: git-send-email 1.5.4.rc2.85.g9de45-dirty Content-transfer-encoding: 7BIT X-Barracuda-Connect: mta5.srv.hcvlny.cv.net[167.206.4.200] X-Barracuda-Start-Time: 1200875776 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40027 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5504/Sun Jan 20 12:29:54 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14207 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jeffpc@josefsipek.net Precedence: bulk X-list: xfs Signed-off-by: Josef 'Jeff' Sipek --- I tested it with xfsqa, and things work as well as they do without it. --- fs/xfs/xfs_mount.h | 2 +- fs/xfs/xfs_trans.h | 7 +--- fs/xfs/xfs_trans_ail.c | 91 +++++++++++++++++++++--------------------------- 3 files changed, 42 insertions(+), 58 deletions(-) diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index f7c620e..435d625 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -220,7 +220,7 @@ extern void xfs_icsb_sync_counters_flags(struct xfs_mount *, int); #endif typedef struct xfs_ail { - xfs_ail_entry_t xa_ail; + struct list_head xa_ail; uint xa_gen; struct task_struct *xa_task; xfs_lsn_t xa_target; diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h index 7f40628..50ce02b 100644 --- a/fs/xfs/xfs_trans.h +++ b/fs/xfs/xfs_trans.h @@ -113,13 +113,8 @@ struct xfs_mount; struct xfs_trans; struct xfs_dquot_acct; -typedef struct xfs_ail_entry { - struct xfs_log_item *ail_forw; /* AIL forw pointer */ - struct xfs_log_item *ail_back; /* AIL back pointer */ -} xfs_ail_entry_t; - typedef struct xfs_log_item { - xfs_ail_entry_t li_ail; /* AIL pointers */ + struct list_head li_ail; /* AIL pointers */ xfs_lsn_t li_lsn; /* last on-disk lsn */ struct xfs_log_item_desc *li_desc; /* ptr to current desc*/ struct xfs_mount *li_mountp; /* ptr to fs mount */ diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c index 4d6330e..c3d402d 100644 --- a/fs/xfs/xfs_trans_ail.c +++ b/fs/xfs/xfs_trans_ail.c @@ -28,10 +28,10 @@ #include "xfs_trans_priv.h" #include "xfs_error.h" -STATIC void xfs_ail_insert(xfs_ail_entry_t *, xfs_log_item_t *); -STATIC xfs_log_item_t * xfs_ail_delete(xfs_ail_entry_t *, xfs_log_item_t *); -STATIC xfs_log_item_t * xfs_ail_min(xfs_ail_entry_t *); -STATIC xfs_log_item_t * xfs_ail_next(xfs_ail_entry_t *, xfs_log_item_t *); +STATIC void xfs_ail_insert(struct list_head *, xfs_log_item_t *); +STATIC xfs_log_item_t * xfs_ail_delete(struct list_head *, xfs_log_item_t *); +STATIC xfs_log_item_t * xfs_ail_min(struct list_head *); +STATIC xfs_log_item_t * xfs_ail_next(struct list_head *, xfs_log_item_t *); #ifdef DEBUG STATIC void xfs_ail_check(xfs_ail_entry_t *, xfs_log_item_t *); @@ -116,10 +116,12 @@ xfs_trans_first_push_ail( if (lsn == 0) return lip; - while (lip && (XFS_LSN_CMP(lip->li_lsn, lsn) < 0)) - lip = lip->li_ail.ail_forw; + list_for_each_entry(lip, &mp->m_ail.xa_ail, li_ail) { + if (XFS_LSN_CMP(lip->li_lsn, lsn) >= 0) + return lip; + } - return lip; + return NULL; } /* @@ -354,15 +356,13 @@ xfs_trans_update_ail( xfs_log_item_t *lip, xfs_lsn_t lsn) __releases(mp->m_ail_lock) { - xfs_ail_entry_t *ailp; xfs_log_item_t *dlip=NULL; xfs_log_item_t *mlip; /* ptr to minimum lip */ - ailp = &(mp->m_ail.xa_ail); - mlip = xfs_ail_min(ailp); + mlip = xfs_ail_min(&mp->m_ail.xa_ail); if (lip->li_flags & XFS_LI_IN_AIL) { - dlip = xfs_ail_delete(ailp, lip); + dlip = xfs_ail_delete(&mp->m_ail.xa_ail, lip); ASSERT(dlip == lip); } else { lip->li_flags |= XFS_LI_IN_AIL; @@ -370,11 +370,11 @@ xfs_trans_update_ail( lip->li_lsn = lsn; - xfs_ail_insert(ailp, lip); + xfs_ail_insert(&mp->m_ail.xa_ail, lip); mp->m_ail.xa_gen++; if (mlip == dlip) { - mlip = xfs_ail_min(&(mp->m_ail.xa_ail)); + mlip = xfs_ail_min(&mp->m_ail.xa_ail); spin_unlock(&mp->m_ail_lock); xfs_log_move_tail(mp, mlip->li_lsn); } else { @@ -404,14 +404,12 @@ xfs_trans_delete_ail( xfs_mount_t *mp, xfs_log_item_t *lip) __releases(mp->m_ail_lock) { - xfs_ail_entry_t *ailp; xfs_log_item_t *dlip; xfs_log_item_t *mlip; if (lip->li_flags & XFS_LI_IN_AIL) { - ailp = &(mp->m_ail.xa_ail); - mlip = xfs_ail_min(ailp); - dlip = xfs_ail_delete(ailp, lip); + mlip = xfs_ail_min(&mp->m_ail.xa_ail); + dlip = xfs_ail_delete(&mp->m_ail.xa_ail, lip); ASSERT(dlip == lip); @@ -514,8 +512,7 @@ int xfs_trans_ail_init( xfs_mount_t *mp) { - mp->m_ail.xa_ail.ail_forw = (xfs_log_item_t*)&mp->m_ail.xa_ail; - mp->m_ail.xa_ail.ail_back = (xfs_log_item_t*)&mp->m_ail.xa_ail; + INIT_LIST_HEAD(&mp->m_ail.xa_ail); return xfsaild_start(mp); } @@ -534,8 +531,8 @@ xfs_trans_ail_destroy( */ STATIC void xfs_ail_insert( - xfs_ail_entry_t *base, - xfs_log_item_t *lip) + struct list_head *base, + xfs_log_item_t *lip) /* ARGSUSED */ { xfs_log_item_t *next_lip; @@ -543,25 +540,20 @@ xfs_ail_insert( /* * If the list is empty, just insert the item. */ - if (base->ail_back == (xfs_log_item_t*)base) { - base->ail_forw = lip; - base->ail_back = lip; - lip->li_ail.ail_forw = (xfs_log_item_t*)base; - lip->li_ail.ail_back = (xfs_log_item_t*)base; + if (list_empty(base)) { + list_add(&lip->li_ail, base); return; } - next_lip = base->ail_back; - while ((next_lip != (xfs_log_item_t*)base) && - (XFS_LSN_CMP(next_lip->li_lsn, lip->li_lsn) > 0)) { - next_lip = next_lip->li_ail.ail_back; + list_for_each_entry_reverse(next_lip, base, li_ail) { + if (XFS_LSN_CMP(next_lip->li_lsn, lip->li_lsn) <= 0) + break; } - ASSERT((next_lip == (xfs_log_item_t*)base) || + + ASSERT((&next_lip->li_ail == base) || (XFS_LSN_CMP(next_lip->li_lsn, lip->li_lsn) <= 0)); - lip->li_ail.ail_forw = next_lip->li_ail.ail_forw; - lip->li_ail.ail_back = next_lip; - next_lip->li_ail.ail_forw = lip; - lip->li_ail.ail_forw->li_ail.ail_back = lip; + + list_add(&lip->li_ail, &next_lip->li_ail); xfs_ail_check(base, lip); return; @@ -573,15 +565,13 @@ xfs_ail_insert( /*ARGSUSED*/ STATIC xfs_log_item_t * xfs_ail_delete( - xfs_ail_entry_t *base, - xfs_log_item_t *lip) + struct list_head *base, + xfs_log_item_t *lip) /* ARGSUSED */ { xfs_ail_check(base, lip); - lip->li_ail.ail_forw->li_ail.ail_back = lip->li_ail.ail_back; - lip->li_ail.ail_back->li_ail.ail_forw = lip->li_ail.ail_forw; - lip->li_ail.ail_forw = NULL; - lip->li_ail.ail_back = NULL; + + list_del(&lip->li_ail); return lip; } @@ -592,14 +582,13 @@ xfs_ail_delete( */ STATIC xfs_log_item_t * xfs_ail_min( - xfs_ail_entry_t *base) + struct list_head *base) /* ARGSUSED */ { - register xfs_log_item_t *forw = base->ail_forw; - if (forw == (xfs_log_item_t*)base) { + if (list_empty(base)) return NULL; - } - return forw; + + return list_first_entry(base, xfs_log_item_t, li_ail); } /* @@ -609,14 +598,14 @@ xfs_ail_min( */ STATIC xfs_log_item_t * xfs_ail_next( - xfs_ail_entry_t *base, - xfs_log_item_t *lip) + struct list_head *base, + xfs_log_item_t *lip) /* ARGSUSED */ { - if (lip->li_ail.ail_forw == (xfs_log_item_t*)base) { + if (lip->li_ail.next == base) return NULL; - } - return lip->li_ail.ail_forw; + + return list_first_entry(&lip->li_ail, xfs_log_item_t, li_ail); } -- 1.5.4.rc2.85.g9de45-dirty From owner-xfs@oss.sgi.com Sun Jan 20 16:51:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 16:51:54 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L0pihX021203 for ; Sun, 20 Jan 2008 16:51:49 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA19036; Mon, 21 Jan 2008 11:51:59 +1100 Date: Mon, 21 Jan 2008 11:52:19 +1100 To: "Martin Steigerwald" , linux-xfs@oss.sgi.com Subject: Re: [REVIEW 0/2] Case insensitive support for XFS From: "Barry Naujok" Organization: SGI Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <200801181905.05263.Martin@lichtvoll.de> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <200801181905.05263.Martin@lichtvoll.de> User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5504/Sun Jan 20 12:29:54 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14208 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Sat, 19 Jan 2008 05:05:04 +1100, Martin Steigerwald wrote: > > Hi Barry! > > Am Freitag 18 Januar 2008 schrieb Barry Naujok: > >> There are two mount options for enabling case-insensitivity >> on a Unicode XFS filesystem: >> - "ci" - enables case-insensitivity for file names >> - "ciattr" - enables case-insensitivity for extended >> attributes. > > How do I know that I am on an Unicode XFS filesystem. Could I see this > with xfs_db -r -c 'sb 0' -c p ? Hmm, nothing unicode related in > there as far as I can see. The fs was created with 2.6.23, mkfs.xfs 2.9.4 > and the mkfs options that David suggested. Good point, xfs_info should report this info. > Do I need to backup / mkfs / restore to switch to one? I understand that > I > can switch between enable / disable case-insensitivity via a mount > option. Would I be able to enable unicode via xfs_db version command or > something like it? > > Just curious. Strictly speaking you do need to do backup/mkfs/restore to get utf8. But, with xfs_db hackery and xfs_repair, you can actually switch between them without mkfsing (I never said that ;) ) Once your filesystem is unicode, ci is a mount option that can be turned on/off. Barry. From owner-xfs@oss.sgi.com Sun Jan 20 16:53:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 16:53:49 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L0rhE1021457 for ; Sun, 20 Jan 2008 16:53:45 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA19084; Mon, 21 Jan 2008 11:53:57 +1100 Date: Mon, 21 Jan 2008 11:54:18 +1100 To: "Eric Sandeen" Subject: Re: [REVIEW 2/2] Case insensitive support for XFS - user-space From: "Barry Naujok" Organization: SGI Cc: "xfs@oss.sgi.com" , xfs-dev Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <479118CF.1020302@sandeen.net> Message-ID: In-Reply-To: <479118CF.1020302@sandeen.net> User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5504/Sun Jan 20 12:29:54 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from Quoted-Printable to 8bit by oss.sgi.com id m0L0rlE1021475 X-archive-position: 14209 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Sat, 19 Jan 2008 08:23:27 +1100, Eric Sandeen wrote: > Barry Naujok wrote: >> This patch relies on the dinode.c refactoring patch posted recently. >> I have attached the latest version (with fixes pointed out by Chandan). > > So, new mkfs.xfs -h output says: > > /* naming */ [-n log=n|size=num,version=n,utf8=none|default|turkic] > > so I tried: > > mkfs.xfs -dfile,name=fsfile,size=500m -nutf8=none > > and got: > > Illegal value none for -n utf8 option Bad usage on my part. I have changed it to: /* naming */ [-n log=n|size=num,version=n,utf8[=default|turkic]] > (are there man page updates lurking somewhere? Pls also update > Documentation/filesystems/xfs.txt in the kernel) Yes, these are coming. From owner-xfs@oss.sgi.com Sun Jan 20 17:05:06 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 17:05:10 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L1520h022588 for ; Sun, 20 Jan 2008 17:05:05 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA19342; Mon, 21 Jan 2008 12:05:16 +1100 To: nscott@aconex.com, "Martin Steigerwald" Subject: Re: [REVIEW 0/2] Case insensitive support for XFS From: "Barry Naujok" Organization: SGI Cc: linux-xfs@oss.sgi.com Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <200801181905.05263.Martin@lichtvoll.de> <1200868214.9463.274.camel@edge.scott.net.au> Content-Transfer-Encoding: 7bit Date: Mon, 21 Jan 2008 12:05:40 +1100 Message-ID: In-Reply-To: <1200868214.9463.274.camel@edge.scott.net.au> User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5504/Sun Jan 20 12:29:54 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14210 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Mon, 21 Jan 2008 09:30:14 +1100, Nathan Scott wrote: > On Fri, 2008-01-18 at 19:05 +0100, Martin Steigerwald wrote: > >> can switch between enable / disable case-insensitivity via a mount >> option. > > No. Umm, that's a yes :) From owner-xfs@oss.sgi.com Sun Jan 20 17:09:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 17:09:07 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0L190UD023051 for ; Sun, 20 Jan 2008 17:09:03 -0800 X-ASG-Debug-ID: 1200877756-3b9602f70000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from postoffice.aconex.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6B2AFCA9A3C for ; Sun, 20 Jan 2008 17:09:17 -0800 (PST) Received: from postoffice.aconex.com (prod.aconex.com [203.89.192.138]) by cuda.sgi.com with ESMTP id yKVsTUXThZYAnAq9 for ; Sun, 20 Jan 2008 17:09:17 -0800 (PST) Received: from edge.scott.net.au (unknown [203.89.192.141]) by postoffice.aconex.com (Postfix) with ESMTP id EA9A992CECB; Mon, 21 Jan 2008 12:09:15 +1100 (EST) X-ASG-Orig-Subj: Re: [REVIEW 0/2] Case insensitive support for XFS Subject: Re: [REVIEW 0/2] Case insensitive support for XFS From: Nathan Scott Reply-To: nscott@aconex.com To: Barry Naujok Cc: Martin Steigerwald , linux-xfs@oss.sgi.com In-Reply-To: References: <200801181905.05263.Martin@lichtvoll.de> <1200868214.9463.274.camel@edge.scott.net.au> Content-Type: text/plain Organization: Aconex Date: Mon, 21 Jan 2008 12:12:21 +1100 Message-Id: <1200877941.9463.292.camel@edge.scott.net.au> Mime-Version: 1.0 X-Mailer: Evolution 2.6.3 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: prod.aconex.com[203.89.192.138] X-Barracuda-Start-Time: 1200877760 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40030 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5504/Sun Jan 20 12:29:54 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14211 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: nscott@aconex.com Precedence: bulk X-list: xfs On Mon, 2008-01-21 at 12:05 +1100, Barry Naujok wrote: > > > > > On Mon, 21 Jan 2008 09:30:14 +1100, Nathan Scott > wrote: > > > On Fri, 2008-01-18 at 19:05 +0100, Martin Steigerwald wrote: > > > >> can switch between enable / disable case-insensitivity via a mount > >> option. > > > > No. > > Umm, that's a yes :) Ahem, you snipped the context precending that question! Surely you can't switch, unless the case-insensitive mkfs option was used initially...? (unlike, say attr2, which can be enabled on-the-fly with a mount option, on existing attr1 filesystems). cheers. -- Nathan From owner-xfs@oss.sgi.com Sun Jan 20 17:23:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 17:23:18 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L1N7U2024095 for ; Sun, 20 Jan 2008 17:23:12 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA19711; Mon, 21 Jan 2008 12:23:22 +1100 Date: Mon, 21 Jan 2008 12:23:50 +1100 To: nscott@aconex.com Subject: Re: [REVIEW 0/2] Case insensitive support for XFS From: "Barry Naujok" Organization: SGI Cc: "Martin Steigerwald" , linux-xfs@oss.sgi.com Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <200801181905.05263.Martin@lichtvoll.de> <1200868214.9463.274.camel@edge.scott.net.au> <1200877941.9463.292.camel@edge.scott.net.au> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <1200877941.9463.292.camel@edge.scott.net.au> User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14212 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Mon, 21 Jan 2008 12:12:21 +1100, Nathan Scott wrote: > On Mon, 2008-01-21 at 12:05 +1100, Barry Naujok wrote: >> >> >> >> >> On Mon, 21 Jan 2008 09:30:14 +1100, Nathan Scott >> wrote: >> >> > On Fri, 2008-01-18 at 19:05 +0100, Martin Steigerwald wrote: >> > >> >> can switch between enable / disable case-insensitivity via a mount >> >> option. >> > >> > No. >> >> Umm, that's a yes :) > > Ahem, you snipped the context precending that question! > Surely you can't switch, unless the case-insensitive mkfs option was > used initially...? (unlike, say attr2, which can be enabled on-the-fly > with a mount option, on existing attr1 filesystems). You mkfs with unicode/utf8, ci is indeed a mount option which can be turned on and off on the fly. True, you can't just do it on any existing filesystem (except the undocumented/unrecommended xfs_db/xfs_repair method). Barry. From owner-xfs@oss.sgi.com Sun Jan 20 18:06:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 18:06:39 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L26Ttp027064 for ; Sun, 20 Jan 2008 18:06:35 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA20390; Mon, 21 Jan 2008 13:06:43 +1100 To: "Eric Sandeen" Subject: Re: [REVIEW 2/2] Case insensitive support for XFS - user-space From: "Barry Naujok" Organization: SGI Cc: "xfs@oss.sgi.com" , xfs-dev Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <479118CF.1020302@sandeen.net> <47919214.9000807@sandeen.net> Date: Mon, 21 Jan 2008 13:07:21 +1100 Message-ID: In-Reply-To: <47919214.9000807@sandeen.net> User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from Quoted-Printable to 8bit by oss.sgi.com id m0L26btp027069 X-archive-position: 14213 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Sat, 19 Jan 2008 17:00:52 +1100, Eric Sandeen wrote: > Eric Sandeen wrote: > >> Also, if I specify -nutf8=default on a 500m fs: >> >> # mkfs.xfs -dfile,name=fsfile,size=500m -nutf8=default >> meta-data=fsfile isize=256 agcount=4, agsize=32000 >> blks >> = sectsz=512 attr=2 >> data = bsize=4096 blocks=128000, imaxpct=25 >> = sunit=0 swidth=0 blks >> naming =version 2 bsize=4096 utf8=default >> log =internal log bsize=4096 blocks=1200, version=2 >> = sectsz=512 sunit=0 blks, lazy-count=0 >> realtime =none extsz=4096 blocks=0, rtextents=0 >> mkfs.xfs: cannot reserve space: No space left on device > > /* > * allocate the inode > */ > tp = libxfs_trans_alloc(mp, 0); > error = libxfs_trans_reserve(tp, XFS_CREATE_LOG_RES(mp), 0, 0, > 0, 0); Can you try this instead? error = libxfs_trans_reserve(tp, XFS_IALLOC_BLOCKS(mp) + (XFS_IN_MAXLEVELS(mp) - 1), 0, 0, 0, 0); > if (error) { > fprintf(stderr, _("%s: 1: cannot reserve space: %s > (%d)\n"), > progname, strerror(error), > XFS_CREATE_LOG_RES(mp)); > exit(1); > } > > > I think there are some wrong arguments to that trans_reserve... at least > XFS_CREATE_LOG_RES should be 3rd arg, no? > > -Eric From owner-xfs@oss.sgi.com Sun Jan 20 18:15:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 18:15:33 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L2FOqV028227 for ; Sun, 20 Jan 2008 18:15:29 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA20490; Mon, 21 Jan 2008 13:15:37 +1100 To: "Eric Sandeen" Subject: Re: [REVIEW 2/2] Case insensitive support for XFS - user-space From: "Barry Naujok" Organization: SGI Cc: "xfs@oss.sgi.com" , xfs-dev Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <479118CF.1020302@sandeen.net> <47919214.9000807@sandeen.net> Date: Mon, 21 Jan 2008 13:16:17 +1100 Message-ID: In-Reply-To: User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from Quoted-Printable to 8bit by oss.sgi.com id m0L2FUqV028232 X-archive-position: 14214 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Mon, 21 Jan 2008 13:07:21 +1100, Barry Naujok wrote: > On Sat, 19 Jan 2008 17:00:52 +1100, Eric Sandeen > wrote: > >> Eric Sandeen wrote: >> >>> Also, if I specify -nutf8=default on a 500m fs: >>> >>> # mkfs.xfs -dfile,name=fsfile,size=500m -nutf8=default >>> meta-data=fsfile isize=256 agcount=4, agsize=32000 >>> blks >>> = sectsz=512 attr=2 >>> data = bsize=4096 blocks=128000, imaxpct=25 >>> = sunit=0 swidth=0 blks >>> naming =version 2 bsize=4096 utf8=default >>> log =internal log bsize=4096 blocks=1200, version=2 >>> = sectsz=512 sunit=0 blks, >>> lazy-count=0 >>> realtime =none extsz=4096 blocks=0, rtextents=0 >>> mkfs.xfs: cannot reserve space: No space left on device >> >> /* >> * allocate the inode >> */ >> tp = libxfs_trans_alloc(mp, 0); >> error = libxfs_trans_reserve(tp, XFS_CREATE_LOG_RES(mp), 0, 0, >> 0, 0); > > Can you try this instead? > > error = libxfs_trans_reserve(tp, XFS_IALLOC_BLOCKS(mp) + > (XFS_IN_MAXLEVELS(mp) - 1), 0, 0, 0, 0); BTW. this fix works for me :) >> if (error) { >> fprintf(stderr, _("%s: 1: cannot reserve space: %s >> (%d)\n"), >> progname, strerror(error), >> XFS_CREATE_LOG_RES(mp)); >> exit(1); >> } >> >> >> I think there are some wrong arguments to that trans_reserve... at least >> XFS_CREATE_LOG_RES should be 3rd arg, no? >> >> -Eric > > > > From owner-xfs@oss.sgi.com Sun Jan 20 18:31:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 18:31:57 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0L2VnA6029210 for ; Sun, 20 Jan 2008 18:31:53 -0800 X-ASG-Debug-ID: 1200882725-464a001f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6237253E5B1 for ; Sun, 20 Jan 2008 18:32:06 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id jXXjziANWAfJisWs for ; Sun, 20 Jan 2008 18:32:06 -0800 (PST) Received: from Liberator.local (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 477DB18D92285; Sun, 20 Jan 2008 20:31:33 -0600 (CST) Message-ID: <47940404.1000009@sandeen.net> Date: Sun, 20 Jan 2008 20:31:32 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Barry Naujok CC: "xfs@oss.sgi.com" , xfs-dev X-ASG-Orig-Subj: Re: [REVIEW 2/2] Case insensitive support for XFS - user-space Subject: Re: [REVIEW 2/2] Case insensitive support for XFS - user-space References: <479118CF.1020302@sandeen.net> <47919214.9000807@sandeen.net> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200882729 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40034 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14215 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Barry Naujok wrote: >>> error = libxfs_trans_reserve(tp, XFS_CREATE_LOG_RES(mp), 0, 0, >>> 0, 0); >> Can you try this instead? >> >> error = libxfs_trans_reserve(tp, XFS_IALLOC_BLOCKS(mp) + >> (XFS_IN_MAXLEVELS(mp) - 1), 0, 0, 0, 0); > > BTW. this fix works for me :) Ok, I'll trust you then. I haven't looked at what those macros do, context, etc... and probably not going to go look right now :) -Eric From owner-xfs@oss.sgi.com Sun Jan 20 18:55:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 18:55:15 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L2t9EH030670 for ; Sun, 20 Jan 2008 18:55:11 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA21375; Mon, 21 Jan 2008 13:55:17 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0L2tELF32404693; Mon, 21 Jan 2008 13:55:15 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0L2tBQl32422913; Mon, 21 Jan 2008 13:55:11 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Mon, 21 Jan 2008 13:55:10 +1100 From: David Chinner To: Christian Kujau Cc: xfs@oss.sgi.com, LKML , peterz@infradead.org, mingo@redhat.com Subject: Re: 2.6.24-rc8: possible circular locking dependency detected Message-ID: <20080121025510.GY155259@sgi.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14216 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Fri, Jan 18, 2008 at 10:45:17PM +0100, Christian Kujau wrote: > Hi, > > just FYI, upgrading to -rc8 gave the following messages in kern.log in > the morning hours, when the backups were run: > > ======================================================= > [ INFO: possible circular locking dependency detected ] > 2.6.24-rc8 #2 > ------------------------------------------------------- > rsync/23295 is trying to acquire lock: > (iprune_mutex){--..}, at: [] shrink_icache_memory+0x72/0x220 > > but task is already holding lock: > (&(&ip->i_iolock)->mr_lock){----}, at: [] xfs_ilock+0x96/0xb0 > > which lock already depends on the new lock. memory reclaim can occur when an inode lock is held, causing i_iolock -> iprune_mutex to occur. This is quite common. During reclaim, while holding iprune_mutex, we lock a different inode to complete the cleaning up of it, resulting in iprune_mutex -> i_iolock. At this point, lockdep gets upset and blats out a warning. But, there's no problem here as it is always safe for us to take the i_iolock in inode reclaim because it can never be the same as the i_iolock that we've taken prior to memory reclaim being entered. Therefore false positive. Lockdep folk - we really need an annotation to prevent this false positive from being reported because we are getting reports at least once a week.... Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Sun Jan 20 19:46:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 19:46:35 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0L3kQCS001928 for ; Sun, 20 Jan 2008 19:46:28 -0800 X-ASG-Debug-ID: 1200887201-58d0012d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5D6A9CAAF8E for ; Sun, 20 Jan 2008 19:46:41 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id aZfDu9uos8T83coI for ; Sun, 20 Jan 2008 19:46:41 -0800 (PST) Received: from Liberator.local (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 72ED318D9045B; Sun, 20 Jan 2008 21:46:39 -0600 (CST) Message-ID: <4794159F.9070505@sandeen.net> Date: Sun, 20 Jan 2008 21:46:39 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: xfs-oss , Niv Sardi X-ASG-Orig-Subj: small problem w/ new xfs defaults patch Subject: small problem w/ new xfs defaults patch Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200887206 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40039 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14217 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 Index: xfsprogs-2.9.4/growfs/xfs_growfs.c =================================================================== --- xfsprogs-2.9.4.orig/growfs/xfs_growfs.c +++ xfsprogs-2.9.4/growfs/xfs_growfs.c @@ -58,7 +58,6 @@ report_info( int isint, char *logname, char *rtname, - int unwritten, int lazycount, int dirversion, int logversion, @@ -68,7 +67,7 @@ report_info( "meta-data=%-22s isize=%-6u agcount=%u, agsize=%u blks\n" " =%-22s sectsz=%-5u attr=%u\n" "data =%-22s bsize=%-6u blocks=%llu, imaxpct=%u\n" - " =%-22s sunit=%-6u swidth=%u blks, unwritten=%u\n" + " =%-22s sunit=%-6u swidth=%u blks" "naming =version %-14u bsize=%-6u\n" "log =%-22s bsize=%-6u blocks=%u, version=%u\n" " =%-22s sectsz=%-5u sunit=%u blks, lazy-count=%u\n" couple things... you lost a "\n" off the end of the data section there... Also, do you really want to drop reporting of unwritten extents? Even if you're disallowing the selection on new mkfs's there may still be different flavors of filesystems in existence, should it still be reported? -Eric From owner-xfs@oss.sgi.com Sun Jan 20 19:51:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 19:52:01 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=AWL,BAYES_20,J_CHICKENPOX_33, J_CHICKENPOX_41,J_CHICKENPOX_42,J_CHICKENPOX_45,J_CHICKENPOX_47, J_CHICKENPOX_48,J_CHICKENPOX_51,J_CHICKENPOX_53,J_CHICKENPOX_55, J_CHICKENPOX_57,J_CHICKENPOX_61,J_CHICKENPOX_62,J_CHICKENPOX_65, J_CHICKENPOX_66,J_CHICKENPOX_71 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L3pmvK002497 for ; Sun, 20 Jan 2008 19:51:50 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA22506; Mon, 21 Jan 2008 14:51:58 +1100 Date: Mon, 21 Jan 2008 14:53:02 +1100 To: "Eric Sandeen" Subject: Re: [REVIEW 1/2] Case insensitive support for XFS - kernel patch From: "Barry Naujok" Organization: SGI Cc: "xfs@oss.sgi.com" , xfs-dev Content-Type: multipart/mixed; boundary=----------OopNAZbFULX3uI7ekf9jl6 MIME-Version: 1.0 References: <47918927.2000603@sandeen.net> Message-ID: In-Reply-To: <47918927.2000603@sandeen.net> User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14218 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs ------------OopNAZbFULX3uI7ekf9jl6 Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 Content-Transfer-Encoding: 7bit On Sat, 19 Jan 2008 16:22:47 +1100, Eric Sandeen wrote: > Lots of comments below; I have addressed the "real" ones :) - xfs_unicode.c functions do not return negative error codes anymore. - Fixed up the indenting in the patch. - Added a few comments for things that weren't clear. - Made sure my changes didn't exceed 80 char lines. No sub-patches at this stage. ------------OopNAZbFULX3uI7ekf9jl6 Content-Disposition: attachment; filename=ci_kernel.patch Content-Type: text/x-patch; name=ci_kernel.patch Content-Transfer-Encoding: Quoted-Printable =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/Makefile 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/Makefile 2007-10-23 16:17:22.173903950 +1000 @@ -74,6 +74,7 @@ xfs-y +=3D xfs_alloc.o \ xfs_trans_extfree.o \ xfs_trans_inode.o \ xfs_trans_item.o \ + xfs_unicode.o \ xfs_utils.o \ xfs_vfsops.o \ xfs_vnodeops.o \ @@ -97,7 +98,7 @@ xfs-y +=3D $(addprefix $(XFS_LINUX)/, \ xfs_lrw.o \ xfs_super.o \ xfs_vnode.o \ - xfs_ksyms.o) = + xfs_ksyms.o) = # Objects in support/ xfs-y +=3D $(addprefix support/, \ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/linux-2.6/xfs_export.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/linux-2.6/xfs_export.c 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/linux-2.6/xfs_export.c 2008-01-11 14:20:10.000000000 +1100 @@ -217,7 +217,7 @@ xfs_fs_get_parent( struct dentry *parent; = cvp =3D NULL; - error =3D xfs_lookup(XFS_I(child->d_inode), &dotdot, &cvp); + error =3D xfs_lookup(XFS_I(child->d_inode), &dotdot, &cvp, NULL, NULL)= ; if (unlikely(error)) return ERR_PTR(-error); = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/linux-2.6/xfs_iops.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/linux-2.6/xfs_iops.c 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/linux-2.6/xfs_iops.c 2008-01-21 14:27:33.000000000 +1100 @@ -47,6 +47,8 @@ #include "xfs_buf_item.h" #include "xfs_utils.h" #include "xfs_vnodeops.h" +#include "xfs_da_btree.h" +#include "xfs_unicode.h" = #include #include @@ -388,7 +390,7 @@ xfs_vn_lookup( if (dentry->d_name.len >=3D MAXNAMELEN) return ERR_PTR(-ENAMETOOLONG); = - error =3D xfs_lookup(XFS_I(dir), dentry, &cvp); + error =3D xfs_lookup(XFS_I(dir), dentry, &cvp, NULL, NULL); if (unlikely(error)) { if (unlikely(error !=3D ENOENT)) return ERR_PTR(-error); @@ -399,6 +401,113 @@ xfs_vn_lookup( return d_splice_alias(vn_to_inode(cvp), dentry); } = +STATIC struct dentry * +xfs_vn_ci_lookup( + struct inode *dir, + struct dentry *dentry, + struct nameidata *nd) +{ + bhv_vnode_t *cvp; + int error; + struct dentry *result; + struct qstr actual_name; + struct inode *inode; + + if (dentry->d_name.len >=3D MAXNAMELEN) + return ERR_PTR(-ENAMETOOLONG); + + error =3D xfs_lookup(XFS_I(dir), dentry, &cvp, (char **)&actual_name.n= ame, + &actual_name.len); + if (unlikely(error)) { + if (unlikely(error !=3D ENOENT)) + return ERR_PTR(-error); + d_add(dentry, NULL); + return NULL; + } + inode =3D vn_to_inode(cvp); + + /* if exact match, just splice and exit */ + if (!actual_name.name) { + result =3D d_splice_alias(inode, dentry); + return result; + } + + /* + * case-insensitive match, create a dentry to return and fill it + * in with the correctly cased name. Parameter "dentry" is not + * used anymore and the caller will free it. + * Derived from fs/ntfs/namei.c + */ + + actual_name.hash =3D full_name_hash(actual_name.name, actual_name.len)= ; + + /* Does an existing dentry match? */ + result =3D d_lookup(dentry->d_parent, &actual_name); + if (!result) { + /* if not, create one */ + result =3D d_alloc(dentry->d_parent, &actual_name); + xfs_free_unicode_nls_name((char *)actual_name.name); + if (!result) + return ERR_PTR(-ENOMEM); + dentry =3D d_splice_alias(inode, result); + if (dentry) { + dput(result); + return dentry; + } + return result; + } + xfs_free_unicode_nls_name((char *)actual_name.name); + + /* an existing dentry matches, use it */ + + if (result->d_inode) { + /* + * already an inode attached, deref the inode that was + * refcounted with xfs_lookup and return the dentry. + */ + if (unlikely(result->d_inode !=3D inode)) { + /* This can happen because bad inodes are unhashed. */ + BUG_ON(!is_bad_inode(inode)); + BUG_ON(!is_bad_inode(result->d_inode)); + } + iput(inode); + return result; + } + + if (!S_ISDIR(inode->i_mode)) { + /* not a directory, easy to handle */ + d_instantiate(result, inode); + return result; + } + + spin_lock(&dcache_lock); + if (list_empty(&inode->i_dentry)) { + /* + * Directory without a 'disconnected' dentry; we need to do + * d_instantiate() by hand because it takes dcache_lock which + * we already hold. + */ + list_add(&result->d_alias, &inode->i_dentry); + result->d_inode =3D inode; + spin_unlock(&dcache_lock); + security_d_instantiate(result, inode); + return result; + } + /* + * Directory with a 'disconnected' dentry; get a reference to the + * 'disconnected' dentry. + */ + dentry =3D list_entry(inode->i_dentry.next, struct dentry, d_alias); + dget_locked(dentry); + spin_unlock(&dcache_lock); + security_d_instantiate(result, inode); + d_move(dentry, result); + iput(inode); + dput(result); + return dentry; +} + + STATIC int xfs_vn_link( struct dentry *old_dentry, @@ -887,6 +996,25 @@ const struct inode_operations xfs_dir_in .removexattr =3D xfs_vn_removexattr, }; = +const struct inode_operations xfs_dir_ci_inode_operations =3D { + .create =3D xfs_vn_create, + .lookup =3D xfs_vn_ci_lookup, + .link =3D xfs_vn_link, + .unlink =3D xfs_vn_unlink, + .symlink =3D xfs_vn_symlink, + .mkdir =3D xfs_vn_mkdir, + .rmdir =3D xfs_vn_rmdir, + .mknod =3D xfs_vn_mknod, + .rename =3D xfs_vn_rename, + .permission =3D xfs_vn_permission, + .getattr =3D xfs_vn_getattr, + .setattr =3D xfs_vn_setattr, + .setxattr =3D xfs_vn_setxattr, + .getxattr =3D xfs_vn_getxattr, + .listxattr =3D xfs_vn_listxattr, + .removexattr =3D xfs_vn_removexattr, +}; + const struct inode_operations xfs_symlink_inode_operations =3D { .readlink =3D generic_readlink, .follow_link =3D xfs_vn_follow_link, =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/linux-2.6/xfs_iops.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/linux-2.6/xfs_iops.h 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/linux-2.6/xfs_iops.h 2007-10-26 13:19:11.702517171 +1000 @@ -20,6 +20,7 @@ = extern const struct inode_operations xfs_inode_operations; extern const struct inode_operations xfs_dir_inode_operations; +extern const struct inode_operations xfs_dir_ci_inode_operations; extern const struct inode_operations xfs_symlink_inode_operations; = extern const struct file_operations xfs_file_operations; =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/linux-2.6/xfs_ksyms.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/linux-2.6/xfs_ksyms.c 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/linux-2.6/xfs_ksyms.c 2008-01-21 14:27:33.000000000 +1100 @@ -157,6 +157,7 @@ EXPORT_SYMBOL(kmem_zone_init); EXPORT_SYMBOL(kmem_zone_zalloc); EXPORT_SYMBOL(xfs_address_space_operations); EXPORT_SYMBOL(xfs_dir_inode_operations); +EXPORT_SYMBOL(xfs_dir_ci_inode_operations); EXPORT_SYMBOL(xfs_dir_file_operations); EXPORT_SYMBOL(xfs_inode_operations); EXPORT_SYMBOL(xfs_file_operations); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/linux-2.6/xfs_linux.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/linux-2.6/xfs_linux.h 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/linux-2.6/xfs_linux.h 2008-01-11 14:49:16.537591564 +1100 @@ -75,6 +75,8 @@ #include #include #include +#include +#include = #include #include @@ -180,6 +182,12 @@ #define howmany(x, y) (((x)+((y)-1))/(y)) = /* + * NLS UTF-8 character set + */ + +#define XFS_NLS_UTF8 "utf8" + +/* * Various platform dependent calls that don't fit anywhere else */ #define xfs_sort(a,n,s,fn) sort(a,n,s,fn,NULL) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/linux-2.6/xfs_super.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/linux-2.6/xfs_super.c 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/linux-2.6/xfs_super.c 2008-01-21 14:27:33.000000000 +1100 @@ -50,6 +50,7 @@ #include "xfs_vnodeops.h" #include "xfs_vfsops.h" #include "xfs_version.h" +#include "xfs_unicode.h" #include "xfs_log_priv.h" #include "xfs_trans_priv.h" = @@ -122,6 +123,9 @@ xfs_args_allocate( #define MNTOPT_ATTR2 "attr2" /* do use attr2 attribute format */ #define MNTOPT_NOATTR2 "noattr2" /* do not use attr2 attribute format *= / #define MNTOPT_FILESTREAM "filestreams" /* use filestreams allocator *= / +#define MNTOPT_NLS "nls" /* NLS code page to use */ +#define MNTOPT_CILOOKUP "ci" /* case-insensitive dir names */ +#define MNTOPT_CIATTR "ciattr" /* case-insensitive attr names */ #define MNTOPT_QUOTA "quota" /* disk quotas (user) */ #define MNTOPT_NOQUOTA "noquota" /* no quotas */ #define MNTOPT_USRQUOTA "usrquota" /* user quota enabled */ @@ -316,6 +320,18 @@ xfs_parseargs( args->flags &=3D ~XFSMNT_ATTR2; } else if (!strcmp(this_char, MNTOPT_FILESTREAM)) { args->flags2 |=3D XFSMNT2_FILESTREAMS; + } else if (!strcmp(this_char, MNTOPT_NLS)) { + if (!value || !*value) { + cmn_err(CE_WARN, + "XFS: %s option requires an argument", + this_char); + return EINVAL; + } + strncpy(args->nls, value, MAXNAMELEN); + } else if (!strcmp(this_char, MNTOPT_CILOOKUP)) { + args->flags2 |=3D XFSMNT2_CILOOKUP; + } else if (!strcmp(this_char, MNTOPT_CIATTR)) { + args->flags2 |=3D XFSMNT2_CIATTR; } else if (!strcmp(this_char, MNTOPT_NOQUOTA)) { args->flags &=3D ~(XFSMNT_UQUOTAENF|XFSMNT_UQUOTA); args->flags &=3D ~(XFSMNT_GQUOTAENF|XFSMNT_GQUOTA); @@ -455,6 +471,8 @@ xfs_showargs( { XFS_MOUNT_OSYNCISOSYNC, "," MNTOPT_OSYNCISOSYNC }, { XFS_MOUNT_ATTR2, "," MNTOPT_ATTR2 }, { XFS_MOUNT_FILESTREAMS, "," MNTOPT_FILESTREAM }, + { XFS_MOUNT_CI_LOOKUP, "," MNTOPT_CILOOKUP }, + { XFS_MOUNT_CI_ATTR, "," MNTOPT_CIATTR }, { XFS_MOUNT_DMAPI, "," MNTOPT_DMAPI }, { XFS_MOUNT_GRPID, "," MNTOPT_GRPID }, { 0, NULL } @@ -517,6 +535,13 @@ xfs_showargs( if (!(mp->m_qflags & XFS_ALL_QUOTA_ACCT)) seq_puts(m, "," MNTOPT_NOQUOTA); = + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + if (mp->m_nls) + seq_printf(m, "," MNTOPT_NLS "=3D%s", mp->m_nls->charset); + else + seq_puts(m, "," MNTOPT_NLS "=3D" XFS_NLS_UTF8); + } + return 0; } __uint64_t @@ -564,7 +589,11 @@ xfs_set_inodeops( inode->i_mapping->a_ops =3D &xfs_address_space_operations; break; case S_IFDIR: - inode->i_op =3D &xfs_dir_inode_operations; + inode->i_op =3D + xfs_sb_version_hasoldci(&XFS_I(inode)->i_mount->m_sb) || + (XFS_I(inode)->i_mount->m_flags & XFS_MOUNT_CI_LOOKUP) ? + &xfs_dir_ci_inode_operations : + &xfs_dir_inode_operations; inode->i_fop =3D &xfs_dir_file_operations; break; case S_IFLNK: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_attr.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_attr.c 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/xfs_attr.c 2008-01-18 13:25:20.068339942 +1100 @@ -106,6 +106,17 @@ ktrace_t *xfs_attr_trace_buf; * Overall external interface routines. *=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D*/ = +void +xfs_attr_mount(struct xfs_mount *mp) +{ + mp->m_attr_magicpct =3D (mp->m_sb.sb_blocksize * 37) / 100; + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + mp->m_attrnameops =3D (mp->m_flags & XFS_MOUNT_CI_ATTR) ? + &xfs_unicode_ci_nameops : &xfs_unicode_nameops; + } else + mp->m_attrnameops =3D &xfs_default_nameops; +} + int xfs_attr_fetch(xfs_inode_t *ip, const char *name, int namelen, char *value, int *valuelenp, int flags, struct cred *cred) @@ -122,14 +133,14 @@ xfs_attr_fetch(xfs_inode_t *ip, const ch * Fill in the arg structure for this request. */ memset((char *)&args, 0, sizeof(args)); - args.name =3D name; - args.namelen =3D namelen; args.value =3D value; args.valuelen =3D *valuelenp; args.flags =3D flags; - args.hashval =3D xfs_da_hashname(args.name, args.namelen); args.dp =3D ip; args.whichfork =3D XFS_ATTR_FORK; + error =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (error) + return error; = /* * Decide on what work routines to call based on the inode size. @@ -153,6 +164,7 @@ xfs_attr_fetch(xfs_inode_t *ip, const ch = if (error =3D=3D EEXIST) error =3D 0; + xfs_da_cleanup_name(&args, name); return(error); } = @@ -181,6 +193,7 @@ xfs_attr_get( xfs_ilock(ip, XFS_ILOCK_SHARED); error =3D xfs_attr_fetch(ip, name, namelen, value, valuelenp, flags, c= red); xfs_iunlock(ip, XFS_ILOCK_SHARED); + return(error); } = @@ -219,18 +232,18 @@ xfs_attr_set_int(xfs_inode_t *dp, const = * Fill in the arg structure for this request. */ memset((char *)&args, 0, sizeof(args)); - args.name =3D name; - args.namelen =3D namelen; args.value =3D value; args.valuelen =3D valuelen; args.flags =3D flags; - args.hashval =3D xfs_da_hashname(args.name, args.namelen); args.dp =3D dp; args.firstblock =3D &firstblock; args.flist =3D &flist; args.whichfork =3D XFS_ATTR_FORK; args.addname =3D 1; args.oknoent =3D 1; + error =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (error) + return error; = /* * Determine space new attribute will use, and if it would be @@ -282,6 +295,7 @@ xfs_attr_set_int(xfs_inode_t *dp, const = 0, XFS_TRANS_PERM_LOG_RES, XFS_ATTRSET_LOG_COUNT))) { xfs_trans_cancel(args.trans, 0); + xfs_da_cleanup_name(&args, name); return(error); } xfs_ilock(dp, XFS_ILOCK_EXCL); @@ -292,6 +306,7 @@ xfs_attr_set_int(xfs_inode_t *dp, const = if (error) { xfs_iunlock(dp, XFS_ILOCK_EXCL); xfs_trans_cancel(args.trans, XFS_TRANS_RELEASE_LOG_RES); + xfs_da_cleanup_name(&args, name); return (error); } = @@ -342,6 +357,7 @@ xfs_attr_set_int(xfs_inode_t *dp, const = if (!error && (flags & ATTR_KERNOTIME) =3D=3D 0) { xfs_ichgtime(dp, XFS_ICHGTIME_CHG); } + xfs_da_cleanup_name(&args, name); return(error =3D=3D 0 ? err2 : error); } = @@ -411,6 +427,7 @@ xfs_attr_set_int(xfs_inode_t *dp, const = xfs_ichgtime(dp, XFS_ICHGTIME_CHG); } = + xfs_da_cleanup_name(&args, name); return(error); = out: @@ -418,6 +435,7 @@ out: xfs_trans_cancel(args.trans, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT); xfs_iunlock(dp, XFS_ILOCK_EXCL); + xfs_da_cleanup_name(&args, name); return(error); } = @@ -460,21 +478,23 @@ xfs_attr_remove_int(xfs_inode_t *dp, con * Fill in the arg structure for this request. */ memset((char *)&args, 0, sizeof(args)); - args.name =3D name; - args.namelen =3D namelen; args.flags =3D flags; - args.hashval =3D xfs_da_hashname(args.name, args.namelen); args.dp =3D dp; args.firstblock =3D &firstblock; args.flist =3D &flist; args.total =3D 0; args.whichfork =3D XFS_ATTR_FORK; + error =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (error) + return error; = /* * Attach the dquots to the inode. */ - if ((error =3D XFS_QM_DQATTACH(mp, dp, 0))) + if ((error =3D XFS_QM_DQATTACH(mp, dp, 0))) { + xfs_da_cleanup_name(&args, name); return (error); + } = /* * Start our first transaction of the day. @@ -502,6 +522,7 @@ xfs_attr_remove_int(xfs_inode_t *dp, con 0, XFS_TRANS_PERM_LOG_RES, XFS_ATTRRM_LOG_COUNT))) { xfs_trans_cancel(args.trans, 0); + xfs_da_cleanup_name(&args, name); return(error); } = @@ -559,6 +580,7 @@ xfs_attr_remove_int(xfs_inode_t *dp, con xfs_ichgtime(dp, XFS_ICHGTIME_CHG); } = + xfs_da_cleanup_name(&args, name); return(error); = out: @@ -566,6 +588,7 @@ out: xfs_trans_cancel(args.trans, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT); xfs_iunlock(dp, XFS_ILOCK_EXCL); + xfs_da_cleanup_name(&args, name); return(error); } = @@ -634,7 +657,7 @@ xfs_attr_list_int(xfs_attr_list_context_ */ /*ARGSUSED*/ STATIC int -xfs_attr_put_listent(xfs_attr_list_context_t *context, attrnames_t *nam= esp, +xfs_attr_user_list(xfs_attr_list_context_t *context, attrnames_t *names= p, char *name, int namelen, int valuelen, char *value) { @@ -765,7 +788,7 @@ xfs_attr_list( context.alist->al_count =3D 0; context.alist->al_more =3D 0; context.alist->al_offset[0] =3D context.bufsize; - context.put_listent =3D xfs_attr_put_listent; + context.put_listent =3D xfs_attr_user_list; } = if (XFS_FORCED_SHUTDOWN(dp->i_mount)) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_attr_leaf.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_attr_leaf.c 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/xfs_attr_leaf.c 2008-01-21 14:07:01.982908019 +1100 @@ -42,6 +42,7 @@ #include "xfs_attr.h" #include "xfs_attr_leaf.h" #include "xfs_error.h" +#include "xfs_unicode.h" = /* * xfs_attr_leaf.c @@ -90,6 +91,10 @@ STATIC void xfs_attr_leaf_moveents(xfs_a xfs_mount_t *mp); STATIC int xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index)= ; = +STATIC int xfs_attr_put_listent(xfs_attr_list_context_t *context, + attrnames_t *namesp, char *name, + int namelen, int valuelen, char *value); + /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D * Namespace helper routines *=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D*/ @@ -135,6 +140,38 @@ xfs_attr_namesp_match_overrides(int arg_ * External routines when attribute fork size < XFS_LITINO(mp). *=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D*/ = +STATIC xfs_attr_sf_entry_t * +xfs_attr_shortform_find_ent(xfs_da_args_t *args) +{ + xfs_attr_shortform_t *sf; + xfs_attr_sf_entry_t *sfe; + int i; + xfs_attr_sf_entry_t *ci_sfe =3D NULL; + + ASSERT(args->dp->i_afp->if_flags & XFS_IFINLINE); + sf =3D (xfs_attr_shortform_t *)args->dp->i_afp->if_u1.if_data; + sfe =3D &sf->list[0]; + + args->cmpresult =3D XFS_CMP_DIFFERENT; + for (i =3D 0; i < sf->hdr.count; sfe =3D XFS_ATTR_SF_NEXTENTRY(sfe), i= ++) { + if (!xfs_attr_namesp_match(args->flags, sfe->flags)) + continue; + switch (xfs_attr_compname(args->dp, sfe->nameval, sfe->namelen, + args->name, args->namelen)) { + case XFS_CMP_EXACT: + args->cmpresult =3D XFS_CMP_EXACT; + return sfe; + case XFS_CMP_CASE: + if (!ci_sfe) { + args->cmpresult =3D XFS_CMP_CASE; + ci_sfe =3D sfe; + } + default:; + } + } + return ci_sfe; +} + /* * Query whether the requested number of additional bytes of extended * attribute space will be able to fit inline. @@ -295,13 +332,10 @@ xfs_attr_shortform_add(xfs_da_args_t *ar sfe =3D &sf->list[0]; for (i =3D 0; i < sf->hdr.count; sfe =3D XFS_ATTR_SF_NEXTENTRY(sfe), i= ++) { #ifdef DEBUG - if (sfe->namelen !=3D args->namelen) - continue; - if (memcmp(args->name, sfe->nameval, args->namelen) !=3D 0) - continue; if (!xfs_attr_namesp_match(args->flags, sfe->flags)) continue; - ASSERT(0); + ASSERT(xfs_attr_compname(args->dp, args->name, args->namelen, + sfe->nameval, sfe->namelen) =3D=3D XFS_CMP_DIFFERENT); #endif } = @@ -331,29 +365,19 @@ xfs_attr_shortform_remove(xfs_da_args_t = { xfs_attr_shortform_t *sf; xfs_attr_sf_entry_t *sfe; - int base, size=3D0, end, totsize, i; + int base, size, end, totsize; xfs_mount_t *mp; xfs_inode_t *dp; = + sfe =3D xfs_attr_shortform_find_ent(args); + if (!sfe) + return XFS_ERROR(ENOATTR); + dp =3D args->dp; mp =3D dp->i_mount; - base =3D sizeof(xfs_attr_sf_hdr_t); sf =3D (xfs_attr_shortform_t *)dp->i_afp->if_u1.if_data; - sfe =3D &sf->list[0]; - end =3D sf->hdr.count; - for (i =3D 0; i < end; sfe =3D XFS_ATTR_SF_NEXTENTRY(sfe), - base +=3D size, i++) { - size =3D XFS_ATTR_SF_ENTSIZE(sfe); - if (sfe->namelen !=3D args->namelen) - continue; - if (memcmp(sfe->nameval, args->name, args->namelen) !=3D 0) - continue; - if (!xfs_attr_namesp_match(args->flags, sfe->flags)) - continue; - break; - } - if (i =3D=3D end) - return(XFS_ERROR(ENOATTR)); + size =3D XFS_ATTR_SF_ENTSIZE(sfe); + base =3D (int)((char *)sfe - (char *)sf); = /* * Fix up the attribute fork data, covering the hole @@ -412,26 +436,7 @@ xfs_attr_shortform_remove(xfs_da_args_t = int xfs_attr_shortform_lookup(xfs_da_args_t *args) { - xfs_attr_shortform_t *sf; - xfs_attr_sf_entry_t *sfe; - int i; - xfs_ifork_t *ifp; - - ifp =3D args->dp->i_afp; - ASSERT(ifp->if_flags & XFS_IFINLINE); - sf =3D (xfs_attr_shortform_t *)ifp->if_u1.if_data; - sfe =3D &sf->list[0]; - for (i =3D 0; i < sf->hdr.count; - sfe =3D XFS_ATTR_SF_NEXTENTRY(sfe), i++) { - if (sfe->namelen !=3D args->namelen) - continue; - if (memcmp(args->name, sfe->nameval, args->namelen) !=3D 0) - continue; - if (!xfs_attr_namesp_match(args->flags, sfe->flags)) - continue; - return(XFS_ERROR(EEXIST)); - } - return(XFS_ERROR(ENOATTR)); + return XFS_ERROR(xfs_attr_shortform_find_ent(args) ? EEXIST : ENOATTR)= ; } = /* @@ -441,35 +446,24 @@ xfs_attr_shortform_lookup(xfs_da_args_t = int xfs_attr_shortform_getvalue(xfs_da_args_t *args) { - xfs_attr_shortform_t *sf; xfs_attr_sf_entry_t *sfe; - int i; = - ASSERT(args->dp->i_d.di_aformat =3D=3D XFS_IFINLINE); - sf =3D (xfs_attr_shortform_t *)args->dp->i_afp->if_u1.if_data; - sfe =3D &sf->list[0]; - for (i =3D 0; i < sf->hdr.count; - sfe =3D XFS_ATTR_SF_NEXTENTRY(sfe), i++) { - if (sfe->namelen !=3D args->namelen) - continue; - if (memcmp(args->name, sfe->nameval, args->namelen) !=3D 0) - continue; - if (!xfs_attr_namesp_match(args->flags, sfe->flags)) - continue; - if (args->flags & ATTR_KERNOVAL) { - args->valuelen =3D sfe->valuelen; - return(XFS_ERROR(EEXIST)); - } - if (args->valuelen < sfe->valuelen) { - args->valuelen =3D sfe->valuelen; - return(XFS_ERROR(ERANGE)); - } + sfe =3D xfs_attr_shortform_find_ent(args); + if (!sfe) + return XFS_ERROR(ENOATTR); + + if (args->flags & ATTR_KERNOVAL) { args->valuelen =3D sfe->valuelen; - memcpy(args->value, &sfe->nameval[args->namelen], - args->valuelen); - return(XFS_ERROR(EEXIST)); + return XFS_ERROR(EEXIST); } - return(XFS_ERROR(ENOATTR)); + if (args->valuelen < sfe->valuelen) { + args->valuelen =3D sfe->valuelen; + return XFS_ERROR(ERANGE); + } + args->valuelen =3D sfe->valuelen; + memcpy(args->value, &sfe->nameval[args->namelen], args->valuelen); + + return XFS_ERROR(EEXIST); } = /* @@ -535,17 +529,18 @@ xfs_attr_shortform_to_leaf(xfs_da_args_t = sfe =3D &sf->list[0]; for (i =3D 0; i < sf->hdr.count; i++) { - nargs.name =3D (char *)sfe->nameval; - nargs.namelen =3D sfe->namelen; - nargs.value =3D (char *)&sfe->nameval[nargs.namelen]; + nargs.value =3D (char *)&sfe->nameval[sfe->namelen]; nargs.valuelen =3D sfe->valuelen; - nargs.hashval =3D xfs_da_hashname((char *)sfe->nameval, - sfe->namelen); + error =3D xfs_da_setup_name_and_hash(&nargs, sfe->nameval, + sfe->namelen); + if (error) + goto out; nargs.flags =3D XFS_ATTR_NSP_ONDISK_TO_ARGS(sfe->flags); error =3D xfs_attr_leaf_lookup_int(bp, &nargs); /* set a->index */ ASSERT(error =3D=3D ENOATTR); error =3D xfs_attr_leaf_add(bp, &nargs); ASSERT(error !=3D ENOSPC); + xfs_da_cleanup_name(&nargs, sfe->nameval); if (error) goto out; sfe =3D XFS_ATTR_SF_NEXTENTRY(sfe); @@ -631,7 +626,7 @@ xfs_attr_shortform_list(xfs_attr_list_co continue; } namesp =3D xfs_attr_flags_namesp(sfe->flags); - error =3D context->put_listent(context, + error =3D xfs_attr_put_listent(context, namesp, (char *)sfe->nameval, (int)sfe->namelen, @@ -734,7 +729,7 @@ xfs_attr_shortform_list(xfs_attr_list_co cursor->hashval =3D sbp->hash; cursor->offset =3D 0; } - error =3D context->put_listent(context, + error =3D xfs_attr_put_listent(context, namesp, sbp->name, sbp->namelen, @@ -1960,6 +1955,7 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp xfs_attr_leaf_name_remote_t *name_rmt; int probe, span; xfs_dahash_t hashval; + xfs_dacmp_t cmp; = leaf =3D bp->data; ASSERT(be16_to_cpu(leaf->hdr.info.magic) =3D=3D XFS_ATTR_LEAF_MAGIC); @@ -2008,6 +2004,7 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp /* * Duplicate keys may be present, so search all of them for a match. */ + args->cmpresult =3D XFS_CMP_DIFFERENT; for ( ; (probe < be16_to_cpu(leaf->hdr.count)) && (be32_to_cpu(entry->hashval) =3D=3D hashval); entry++, probe++) { @@ -2019,35 +2016,46 @@ xfs_attr_leaf_lookup_int(xfs_dabuf_t *bp * If we are looking for complete entries, show only those. */ if ((args->flags & XFS_ATTR_INCOMPLETE) !=3D - (entry->flags & XFS_ATTR_INCOMPLETE)) { + (entry->flags & XFS_ATTR_INCOMPLETE)) + continue; + if (!xfs_attr_namesp_match(args->flags, entry->flags)) continue; - } if (entry->flags & XFS_ATTR_LOCAL) { name_loc =3D XFS_ATTR_LEAF_NAME_LOCAL(leaf, probe); - if (name_loc->namelen !=3D args->namelen) - continue; - if (memcmp(args->name, (char *)name_loc->nameval, args->namelen) !=3D= 0) - continue; - if (!xfs_attr_namesp_match(args->flags, entry->flags)) - continue; - args->index =3D probe; - return(XFS_ERROR(EEXIST)); + cmp =3D xfs_attr_compname(args->dp, args->name, + args->namelen, name_loc->nameval, + name_loc->namelen); + if (cmp !=3D XFS_CMP_DIFFERENT && + cmp !=3D args->cmpresult) { + args->cmpresult =3D cmp; + args->index =3D probe; + args->rmtblkno =3D 0; + args->rmtblkcnt =3D 0; + if (cmp =3D=3D XFS_CMP_EXACT) + return XFS_ERROR(EEXIST); + } } else { name_rmt =3D XFS_ATTR_LEAF_NAME_REMOTE(leaf, probe); - if (name_rmt->namelen !=3D args->namelen) - continue; - if (memcmp(args->name, (char *)name_rmt->name, - args->namelen) !=3D 0) - continue; - if (!xfs_attr_namesp_match(args->flags, entry->flags)) - continue; - args->index =3D probe; - args->rmtblkno =3D be32_to_cpu(name_rmt->valueblk); - args->rmtblkcnt =3D XFS_B_TO_FSB(args->dp->i_mount, - be32_to_cpu(name_rmt->valuelen)); - return(XFS_ERROR(EEXIST)); + cmp =3D xfs_attr_compname(args->dp, args->name, + args->namelen, name_rmt->name, + name_rmt->namelen); + if (cmp !=3D XFS_CMP_DIFFERENT && + cmp !=3D args->cmpresult) { + args->cmpresult =3D cmp; + args->index =3D probe; + args->rmtblkno =3D + be32_to_cpu(name_rmt->valueblk); + args->rmtblkcnt =3D + XFS_B_TO_FSB(args->dp->i_mount, + be32_to_cpu(name_rmt->valuelen)); + if (cmp =3D=3D XFS_CMP_EXACT) + return XFS_ERROR(EEXIST); + } } } + if (args->cmpresult =3D=3D XFS_CMP_CASE) + return XFS_ERROR(EEXIST); + args->index =3D probe; return(XFS_ERROR(ENOATTR)); } @@ -2074,8 +2082,9 @@ xfs_attr_leaf_getvalue(xfs_dabuf_t *bp, = entry =3D &leaf->entries[args->index]; if (entry->flags & XFS_ATTR_LOCAL) { name_loc =3D XFS_ATTR_LEAF_NAME_LOCAL(leaf, args->index); - ASSERT(name_loc->namelen =3D=3D args->namelen); - ASSERT(memcmp(args->name, name_loc->nameval, args->namelen) =3D=3D 0)= ; + ASSERT(xfs_attr_compname(args->dp, args->name, args->namelen, + name_loc->nameval, name_loc->namelen) !=3D + XFS_CMP_DIFFERENT); valuelen =3D be16_to_cpu(name_loc->valuelen); if (args->flags & ATTR_KERNOVAL) { args->valuelen =3D valuelen; @@ -2086,11 +2095,13 @@ xfs_attr_leaf_getvalue(xfs_dabuf_t *bp, = return(XFS_ERROR(ERANGE)); } args->valuelen =3D valuelen; - memcpy(args->value, &name_loc->nameval[args->namelen], valuelen); + memcpy(args->value, &name_loc->nameval[args->namelen], + valuelen); } else { name_rmt =3D XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index); - ASSERT(name_rmt->namelen =3D=3D args->namelen); - ASSERT(memcmp(args->name, name_rmt->name, args->namelen) =3D=3D 0); + ASSERT(xfs_attr_compname(args->dp, args->name, args->namelen, + name_rmt->nameval, name_rmt->namelen) !=3D + XFS_CMP_DIFFERENT); valuelen =3D be32_to_cpu(name_rmt->valuelen); args->rmtblkno =3D be32_to_cpu(name_rmt->valueblk); args->rmtblkcnt =3D XFS_B_TO_FSB(args->dp->i_mount, valuelen); @@ -2298,7 +2309,8 @@ xfs_attr_leaf_lasthash(xfs_dabuf_t *bp, = *count =3D be16_to_cpu(leaf->hdr.count); if (!leaf->hdr.count) return(0); - return be32_to_cpu(leaf->entries[be16_to_cpu(leaf->hdr.count)-1].hashv= al); + return be32_to_cpu( + leaf->entries[be16_to_cpu(leaf->hdr.count)-1].hashval); } = /* @@ -2316,7 +2328,7 @@ xfs_attr_leaf_entsize(xfs_attr_leafblock if (leaf->entries[index].flags & XFS_ATTR_LOCAL) { name_loc =3D XFS_ATTR_LEAF_NAME_LOCAL(leaf, index); size =3D XFS_ATTR_LEAF_ENTSIZE_LOCAL(name_loc->namelen, - be16_to_cpu(name_loc->valuelen)); + be16_to_cpu(name_loc->valuelen)); } else { name_rmt =3D XFS_ATTR_LEAF_NAME_REMOTE(leaf, index); size =3D XFS_ATTR_LEAF_ENTSIZE_REMOTE(name_rmt->namelen); @@ -2409,7 +2421,8 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, = = if (entry->flags & XFS_ATTR_INCOMPLETE) continue; /* skip incomplete entries */ - if (!xfs_attr_namesp_match_overrides(context->flags, entry->flags)) + if (!xfs_attr_namesp_match_overrides(context->flags, + entry->flags)) continue; = namesp =3D xfs_attr_flags_namesp(entry->flags); @@ -2418,12 +2431,13 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, = xfs_attr_leaf_name_local_t *name_loc =3D XFS_ATTR_LEAF_NAME_LOCAL(leaf, i); = - retval =3D context->put_listent(context, + retval =3D xfs_attr_put_listent(context, namesp, (char *)name_loc->nameval, (int)name_loc->namelen, be16_to_cpu(name_loc->valuelen), - (char *)&name_loc->nameval[name_loc->namelen]); + (char *)&name_loc-> + nameval[name_loc->namelen]); if (retval) return retval; } else { @@ -2441,11 +2455,12 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, = args.valuelen =3D valuelen; args.value =3D kmem_alloc(valuelen, KM_SLEEP); args.rmtblkno =3D be32_to_cpu(name_rmt->valueblk); - args.rmtblkcnt =3D XFS_B_TO_FSB(args.dp->i_mount, valuelen); + args.rmtblkcnt =3D XFS_B_TO_FSB(args.dp->i_mount, + valuelen); retval =3D xfs_attr_rmtval_get(&args); if (retval) return retval; - retval =3D context->put_listent(context, + retval =3D xfs_attr_put_listent(context, namesp, (char *)name_rmt->name, (int)name_rmt->namelen, @@ -2454,7 +2469,7 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, = kmem_free(args.value, valuelen); } else { - retval =3D context->put_listent(context, + retval =3D xfs_attr_put_listent(context, namesp, (char *)name_rmt->name, (int)name_rmt->namelen, @@ -2472,6 +2487,33 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, = return(retval); } = +/* + * Do NLS name conversion if required for attribute name and call + * context's put_listent routine + */ + +STATIC int +xfs_attr_put_listent(xfs_attr_list_context_t *context, attrnames_t *nam= esp, + char *name, int namelen, int valuelen, char *value) +{ + xfs_mount_t *mp =3D context->dp->i_mount; + char *nls_name =3D NULL; + int nls_namelen; + int rval; + + if (!mp->m_nls) + return context->put_listent(context, namesp, name, namelen, + valuelen, value); + + rval =3D xfs_unicode_to_nls(mp->m_nls, name, namelen, &nls_name, + &nls_namelen); + if (rval !=3D 0) + return rval; + rval =3D context->put_listent(context, namesp, nls_name, nls_namelen, + valuelen, value); + xfs_free_unicode_nls_name(nls_name); + return rval; +} = /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D * Manage the INCOMPLETE flag in a leaf entry @@ -2522,8 +2564,8 @@ xfs_attr_leaf_clearflag(xfs_da_args_t *a name =3D (char *)name_rmt->name; } ASSERT(be32_to_cpu(entry->hashval) =3D=3D args->hashval); - ASSERT(namelen =3D=3D args->namelen); - ASSERT(memcmp(name, args->name, namelen) =3D=3D 0); + ASSERT(xfs_attr_compname(args->dp, args->name, args->namelen, + name, namelen) !=3D XFS_CMP_DIFFERENT); #endif /* DEBUG */ = entry->flags &=3D ~XFS_ATTR_INCOMPLETE; @@ -2674,8 +2716,8 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *a name2 =3D (char *)name_rmt->name; } ASSERT(be32_to_cpu(entry1->hashval) =3D=3D be32_to_cpu(entry2->hashval= )); - ASSERT(namelen1 =3D=3D namelen2); - ASSERT(memcmp(name1, name2, namelen1) =3D=3D 0); + ASSERT(xfs_attr_compname(args->dp, name1, namelen1, name2, namelen2) != =3D + XFS_CMP_DIFFERENT); #endif /* DEBUG */ = ASSERT(entry1->flags & XFS_ATTR_INCOMPLETE); @@ -2834,7 +2876,8 @@ xfs_attr_node_inactive(xfs_trans_t **tra if (be16_to_cpu(info->magic) =3D=3D XFS_DA_NODE_MAGIC) { error =3D xfs_attr_node_inactive(trans, dp, child_bp, level+1); - } else if (be16_to_cpu(info->magic) =3D=3D XFS_ATTR_LEAF_MAGIC) { + } else if (be16_to_cpu(info->magic) =3D=3D + XFS_ATTR_LEAF_MAGIC) { error =3D xfs_attr_leaf_inactive(trans, dp, child_bp); } else { @@ -2935,7 +2978,7 @@ xfs_attr_leaf_inactive(xfs_trans_t **tra if (name_rmt->valueblk) { lp->valueblk =3D be32_to_cpu(name_rmt->valueblk); lp->valuelen =3D XFS_B_TO_FSB(dp->i_mount, - be32_to_cpu(name_rmt->valuelen)); + be32_to_cpu(name_rmt->valuelen)); lp++; } } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_attr_leaf.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_attr_leaf.h 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/xfs_attr_leaf.h 2008-01-11 14:16:44.268796245 +1100 @@ -36,6 +36,7 @@ struct xfs_da_args; struct xfs_da_state; struct xfs_da_state_blk; struct xfs_inode; +struct xfs_mount; struct xfs_trans; = /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D @@ -204,6 +205,16 @@ static inline int xfs_attr_leaf_entsize_ return (((bsize) >> 1) + ((bsize) >> 2)); } = +/* + * Do hash and name compare based on nameops + */ +#define xfs_attr_hashname(dp, n, l) \ + ((dp)->i_mount->m_attrnameops->hashname((dp), (n), (l))) + +#define xfs_attr_compname(dp, n1, l1, n2, l2) \ + ((dp)->i_mount->m_attrnameops->compname((dp), (n1), (l1), \ + (n2), (l2))) + = /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D * Structure used to pass context around among the routines. @@ -296,6 +307,7 @@ int xfs_attr_root_inactive(struct xfs_tr /* * Utility routines. */ +void xfs_attr_mount(struct xfs_mount *mp); xfs_dahash_t xfs_attr_leaf_lasthash(struct xfs_dabuf *bp, int *count); int xfs_attr_leaf_order(struct xfs_dabuf *leaf1_bp, struct xfs_dabuf *leaf2_bp); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_clnt.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_clnt.h 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/xfs_clnt.h 2007-11-01 13:16:55.000383139 +1100 @@ -48,6 +48,7 @@ struct xfs_mount_args { char rtname[MAXNAMELEN+1]; /* realtime device filename */ char logname[MAXNAMELEN+1]; /* journal device filename */ char mtpt[MAXNAMELEN+1]; /* filesystem mount point */ + char nls[MAXNAMELEN+1]; /* NLS code page to use */ int sunit; /* stripe unit (BBs) */ int swidth; /* stripe width (BBs), multiple of sunit */ uchar_t iosizelog; /* log2 of the preferred I/O size */ @@ -100,5 +101,9 @@ struct xfs_mount_args { * I/O size in stat(2) */ #define XFSMNT2_FILESTREAMS 0x00000002 /* enable the filestreams * allocator */ +#define XFSMNT2_CILOOKUP 0x00000004 /* enable case-insensitive + * filename lookup */ +#define XFSMNT2_CIATTR 0x00000008 /* enable case-insensitive + * extended attr names */ = #endif /* __XFS_CLNT_H__ */ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_da_btree.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_da_btree.c 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/xfs_da_btree.c 2008-01-21 14:23:59.544205024 +1100 @@ -46,6 +46,7 @@ #include "xfs_dir2_block.h" #include "xfs_dir2_node.h" #include "xfs_error.h" +#include "xfs_unicode.h" = /* * xfs_da_btree.c @@ -1530,6 +1531,106 @@ xfs_da_hashname(const uchar_t *name, int } } = + +static xfs_dahash_t +xfs_default_hashname(xfs_inode_t *inode, const uchar_t *name, int namel= en) +{ + return xfs_da_hashname(name, namelen); +} + +xfs_dacmp_t +xfs_default_compname(xfs_inode_t *inode, const uchar_t *name1, int len1= , + const uchar_t *name2, int len2) +{ + return (len1 =3D=3D len2 && memcmp(name1, name2, len1) =3D=3D 0) ? + XFS_CMP_EXACT : XFS_CMP_DIFFERENT; +} + +static xfs_dahash_t +xfs_unicode_ci_hashname( + xfs_inode_t *inode, + const uchar_t *name, + int namelen) +{ + return xfs_unicode_hash(inode->i_mount->m_cft, name, namelen); +} + +static xfs_dacmp_t +xfs_unicode_ci_compname( + xfs_inode_t *inode, + const uchar_t *name1, + int len1, + const uchar_t *name2, + int len2) +{ + if (len1 =3D=3D len2 && memcmp(name1, name2, len1) =3D=3D 0) + return XFS_CMP_EXACT; + + return xfs_unicode_casecmp(inode->i_mount->m_cft, name1, len1, + name2, len2) =3D=3D 0 ? XFS_CMP_CASE : XFS_CMP_DIFFERENT; +} + +const struct xfs_nameops xfs_default_nameops =3D { + .hashname =3D xfs_default_hashname, + .compname =3D xfs_default_compname +}; + +const struct xfs_nameops xfs_unicode_nameops =3D { + .hashname =3D xfs_unicode_ci_hashname, + .compname =3D xfs_default_compname, +}; + +const struct xfs_nameops xfs_unicode_ci_nameops =3D { + .hashname =3D xfs_unicode_ci_hashname, + .compname =3D xfs_unicode_ci_compname, +}; + +int +xfs_da_setup_name_and_hash( + xfs_da_args_t *args, + const char *name, + int namelen) +{ + xfs_mount_t *mp =3D args->dp->i_mount; + int error; + + /* + * xfs_nls_to_unicode will return an allocated string in + * args->name. Therefore, all calls to xfs_da_setup_name_and_hash + * needs a corresponding call to xfs_da_cleanup_name. + */ + + if (mp->m_nls) { + args->name =3D NULL; + error =3D xfs_nls_to_unicode(mp->m_nls, name, namelen, + (char **)&args->name, &args->namelen); + if (error) + return error; + } else { + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + error =3D xfs_unicode_validate(name, namelen); + if (error) + return error; + } + args->name =3D name; + args->namelen =3D namelen; + } + args->hashval =3D (args->whichfork =3D=3D XFS_ATTR_FORK) ? + xfs_attr_hashname(args->dp, args->name, args->namelen) : + xfs_dir_hashname(args->dp, args->name, args->namelen); + return 0; +} + +void +xfs_da_cleanup_name( + xfs_da_args_t *args, + const char *name) +{ + if ((char *)args->name !=3D name) + xfs_free_unicode_nls_name((char *)args->name); +} + + /* * Add a block to the btree ahead of the file. * Return the new block number to the caller. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_da_btree.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_da_btree.h 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/xfs_da_btree.h 2008-01-14 12:12:32.917055949 +1100 @@ -99,12 +99,21 @@ typedef struct xfs_da_node_entry xfs_da_ *=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D*/ = /* + * Search comparison results + */ +typedef enum { + XFS_CMP_DIFFERENT, /* names are completely different */ + XFS_CMP_EXACT, /* names are exactly the same */ + XFS_CMP_CASE /* names are same but differ in case */ +} xfs_dacmp_t; + +/* * Structure to ease passing around component names. */ typedef struct xfs_da_args { const uchar_t *name; /* string (maybe not NULL terminated) */ int namelen; /* length of string (maybe no NULL) */ - uchar_t *value; /* set of bytes (maybe contain NULLs) */ + uchar_t *value; /* set of bytes (maybe contain NULLs) */ int valuelen; /* length of value */ int flags; /* argument flags (eg: ATTR_NOCREATE) */ xfs_dahash_t hashval; /* hash value of name */ @@ -127,6 +136,7 @@ typedef struct xfs_da_args { unsigned char rename; /* T/F: this is an atomic rename op */ unsigned char addname; /* T/F: this is an add operation */ unsigned char oknoent; /* T/F: ok to return ENOENT, else die */ + xfs_dacmp_t cmpresult; /* name compare result for lookups */ } xfs_da_args_t; = /* @@ -201,12 +211,37 @@ typedef struct xfs_da_state { (uint)(XFS_DA_LOGOFF(BASE, ADDR)), \ (uint)(XFS_DA_LOGOFF(BASE, ADDR)+(SIZE)-1) = +/* + * Name ops for directory and/or attr name operations + */ + +typedef xfs_dahash_t (*xfs_hashname_t)(struct xfs_inode *, const uchar_= t *, + int); +typedef xfs_dacmp_t (*xfs_compname_t)(struct xfs_inode *, const uchar_t= *, + int, const uchar_t *, int); + +typedef struct xfs_nameops { + xfs_hashname_t hashname; + xfs_compname_t compname; +} xfs_nameops_t; + = #ifdef __KERNEL__ /*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D * Function prototypes for the kernel. *=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D*/ = +extern const struct xfs_nameops xfs_default_nameops; +extern const struct xfs_nameops xfs_unicode_nameops; +extern const struct xfs_nameops xfs_unicode_ci_nameops; + +xfs_dacmp_t xfs_default_compname(struct xfs_inode *inode, const uchar_t= *name1, + int len1, const uchar_t *name2, int len2); + +int xfs_da_setup_name_and_hash(xfs_da_args_t *args, const char *name, + int namelen); +void xfs_da_cleanup_name(xfs_da_args_t *args, const char *name); + /* * Routines used for growing the Btree. */ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_dir2.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_dir2.c 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/xfs_dir2.c 2008-01-21 13:21:20.375779062 +1100 @@ -42,8 +42,58 @@ #include "xfs_dir2_node.h" #include "xfs_dir2_trace.h" #include "xfs_error.h" +#include "xfs_unicode.h" #include "xfs_vnodeops.h" = +/* + * V1/OLDCI case-insensitive support for directories + * + * This is ASCII only case support, ie. A-Z. + */ +static xfs_dahash_t +xfs_ascii_ci_hashname( + xfs_inode_t *inode, + const uchar_t *name, + int namelen) +{ + xfs_dahash_t hash; + int i; + + for (i =3D 0, hash =3D 0; i < namelen; i++) + hash =3D tolower(name[i]) ^ rol32(hash, 7); + + return hash; +} + +static xfs_dacmp_t +xfs_ascii_ci_compname( + xfs_inode_t *inode, + const uchar_t *name1, + int len1, + const uchar_t *name2, + int len2) +{ + xfs_dacmp_t result =3D XFS_CMP_EXACT; + int i; + + if (len1 !=3D len2) + return XFS_CMP_DIFFERENT; + + for (i =3D 0; i < len1; i++) { + if (name1[i] =3D=3D name2[i]) + continue; + if (tolower(name1[i]) !=3D tolower(name2[i])) + return XFS_CMP_DIFFERENT; + result =3D XFS_CMP_CASE; + } + + return result; +} + +static const struct xfs_nameops xfs_ascii_ci_nameops =3D { + .hashname =3D xfs_ascii_ci_hashname, + .compname =3D xfs_ascii_ci_compname, +}; = void xfs_dir_mount( @@ -64,6 +114,13 @@ xfs_dir_mount( (mp->m_dirblksize - (uint)sizeof(xfs_da_node_hdr_t)) / (uint)sizeof(xfs_da_node_entry_t); mp->m_dir_magicpct =3D (mp->m_dirblksize * 37) / 100; + + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + mp->m_dirnameops =3D (mp->m_flags & XFS_MOUNT_CI_LOOKUP) ? + &xfs_unicode_ci_nameops : &xfs_unicode_nameops; + } else + mp->m_dirnameops =3D (xfs_sb_version_hasoldci(&mp->m_sb)) ? + &xfs_ascii_ci_nameops : &xfs_default_nameops; } = /* @@ -140,7 +197,7 @@ xfs_dir_init( } = /* - Enter a name in a directory. + * Enter a name in a directory. */ int xfs_dir_createname( @@ -162,9 +219,6 @@ xfs_dir_createname( return rval; XFS_STATS_INC(xs_dir_create); = - args.name =3D name; - args.namelen =3D namelen; - args.hashval =3D xfs_da_hashname(name, namelen); args.inumber =3D inum; args.dp =3D dp; args.firstblock =3D first; @@ -174,32 +228,41 @@ xfs_dir_createname( args.trans =3D tp; args.justcheck =3D 0; args.addname =3D args.oknoent =3D 1; + rval =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (rval) + return rval; = if (dp->i_d.di_format =3D=3D XFS_DINODE_FMT_LOCAL) rval =3D xfs_dir2_sf_addname(&args); else if ((rval =3D xfs_dir2_isblock(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_block_addname(&args); else if ((rval =3D xfs_dir2_isleaf(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_leaf_addname(&args); else rval =3D xfs_dir2_node_addname(&args); +out: + xfs_da_cleanup_name(&args, name); return rval; } = /* - * Lookup a name in a directory, give back the inode number. + * Lookup a name in a directory, give back the inode number and also + * actual name if case-insensitive match. */ + int xfs_dir_lookup( xfs_trans_t *tp, xfs_inode_t *dp, char *name, int namelen, - xfs_ino_t *inum) /* out: inode number */ + xfs_ino_t *inum, /* out: inode number */ + char **actual_name, /* out: actual name if different */ + int *actual_namelen) { xfs_da_args_t args; int rval; @@ -208,9 +271,9 @@ xfs_dir_lookup( ASSERT((dp->i_d.di_mode & S_IFMT) =3D=3D S_IFDIR); XFS_STATS_INC(xs_dir_lookup); = - args.name =3D name; - args.namelen =3D namelen; - args.hashval =3D xfs_da_hashname(name, namelen); + if (actual_name) + *actual_name =3D NULL; + args.inumber =3D 0; args.dp =3D dp; args.firstblock =3D NULL; @@ -220,23 +283,39 @@ xfs_dir_lookup( args.trans =3D tp; args.justcheck =3D args.addname =3D 0; args.oknoent =3D 1; + args.value =3D NULL; /* value may contain actual name on return */ + args.valuelen =3D 0; + rval =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (rval) + return rval; = if (dp->i_d.di_format =3D=3D XFS_DINODE_FMT_LOCAL) rval =3D xfs_dir2_sf_lookup(&args); else if ((rval =3D xfs_dir2_isblock(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_block_lookup(&args); else if ((rval =3D xfs_dir2_isleaf(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_leaf_lookup(&args); else rval =3D xfs_dir2_node_lookup(&args); if (rval =3D=3D EEXIST) rval =3D 0; - if (rval =3D=3D 0) + if (rval =3D=3D 0) { *inum =3D args.inumber; + if (args.value) { + ASSERT(args->cmpresult =3D=3D XFS_CMP_CASE); + if (actual_name) { + *actual_namelen =3D args.valuelen, + *actual_name =3D args.value; + } else + xfs_free_unicode_nls_name(args.value); + } + } +out: + xfs_da_cleanup_name(&args, name); return rval; } = @@ -261,9 +340,6 @@ xfs_dir_removename( ASSERT((dp->i_d.di_mode & S_IFMT) =3D=3D S_IFDIR); XFS_STATS_INC(xs_dir_remove); = - args.name =3D name; - args.namelen =3D namelen; - args.hashval =3D xfs_da_hashname(name, namelen); args.inumber =3D ino; args.dp =3D dp; args.firstblock =3D first; @@ -272,19 +348,24 @@ xfs_dir_removename( args.whichfork =3D XFS_DATA_FORK; args.trans =3D tp; args.justcheck =3D args.addname =3D args.oknoent =3D 0; + rval =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (rval) + return rval; = if (dp->i_d.di_format =3D=3D XFS_DINODE_FMT_LOCAL) rval =3D xfs_dir2_sf_removename(&args); else if ((rval =3D xfs_dir2_isblock(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_block_removename(&args); else if ((rval =3D xfs_dir2_isleaf(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_leaf_removename(&args); else rval =3D xfs_dir2_node_removename(&args); +out: + xfs_da_cleanup_name(&args, name); return rval; } = @@ -345,9 +426,6 @@ xfs_dir_replace( if ((rval =3D xfs_dir_ino_validate(tp->t_mountp, inum))) return rval; = - args.name =3D name; - args.namelen =3D namelen; - args.hashval =3D xfs_da_hashname(name, namelen); args.inumber =3D inum; args.dp =3D dp; args.firstblock =3D first; @@ -356,19 +434,24 @@ xfs_dir_replace( args.whichfork =3D XFS_DATA_FORK; args.trans =3D tp; args.justcheck =3D args.addname =3D args.oknoent =3D 0; + rval =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (rval) + return rval; = if (dp->i_d.di_format =3D=3D XFS_DINODE_FMT_LOCAL) rval =3D xfs_dir2_sf_replace(&args); else if ((rval =3D xfs_dir2_isblock(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_block_replace(&args); else if ((rval =3D xfs_dir2_isleaf(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_leaf_replace(&args); else rval =3D xfs_dir2_node_replace(&args); +out: + xfs_da_cleanup_name(&args, name); return rval; } = @@ -388,9 +471,6 @@ xfs_dir_canenter( = ASSERT((dp->i_d.di_mode & S_IFMT) =3D=3D S_IFDIR); = - args.name =3D name; - args.namelen =3D namelen; - args.hashval =3D xfs_da_hashname(name, namelen); args.inumber =3D 0; args.dp =3D dp; args.firstblock =3D NULL; @@ -399,19 +479,24 @@ xfs_dir_canenter( args.whichfork =3D XFS_DATA_FORK; args.trans =3D tp; args.justcheck =3D args.addname =3D args.oknoent =3D 1; + rval =3D xfs_da_setup_name_and_hash(&args, name, namelen); + if (rval) + return rval; = if (dp->i_d.di_format =3D=3D XFS_DINODE_FMT_LOCAL) rval =3D xfs_dir2_sf_addname(&args); else if ((rval =3D xfs_dir2_isblock(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_block_addname(&args); else if ((rval =3D xfs_dir2_isleaf(tp, dp, &v))) - return rval; + goto out; else if (v) rval =3D xfs_dir2_leaf_addname(&args); else rval =3D xfs_dir2_node_addname(&args); +out: + xfs_da_cleanup_name(&args, name); return rval; } = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_dir2.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_dir2.h 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/xfs_dir2.h 2007-11-01 13:11:00.206583735 +1100 @@ -72,7 +72,8 @@ extern int xfs_dir_createname(struct xfs xfs_fsblock_t *first, struct xfs_bmap_free *flist, xfs_extlen_t tot); extern int xfs_dir_lookup(struct xfs_trans *tp, struct xfs_inode *dp, - char *name, int namelen, xfs_ino_t *inum); + char *name, int namelen, xfs_ino_t *inum, + char **actual_name, int *actual_namelen); extern int xfs_dir_removename(struct xfs_trans *tp, struct xfs_inode *d= p, char *name, int namelen, xfs_ino_t ino, xfs_fsblock_t *first, @@ -85,6 +86,13 @@ extern int xfs_dir_canenter(struct xfs_t char *name, int namelen); extern int xfs_dir_ino_validate(struct xfs_mount *mp, xfs_ino_t ino); = +#define xfs_dir_hashname(dp, n, l) \ + ((dp)->i_mount->m_dirnameops->hashname((dp), (n), (l))) + +#define xfs_dir_compname(dp, n1, l1, n2, l2) \ + ((dp)->i_mount->m_dirnameops->compname((dp), (n1), (l1), \ + (n2), (l2))) + /* * Utility routines for v2 directories. */ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_dir2_block.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_dir2_block.c 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/xfs_dir2_block.c 2008-01-21 13:50:21.175545312 +1100 @@ -38,6 +38,7 @@ #include "xfs_dir2_block.h" #include "xfs_dir2_trace.h" #include "xfs_error.h" +#include "xfs_unicode.h" = /* * Local function prototypes. @@ -450,6 +451,8 @@ xfs_dir2_block_getdents( int wantoff; /* starting block offset */ xfs_ino_t ino; xfs_off_t cook; + char *nls_name =3D NULL; /* NLS name buffer */ + int nls_namelen =3D 0; = mp =3D dp->i_mount; /* @@ -481,6 +484,9 @@ xfs_dir2_block_getdents( ptr =3D (char *)block->u; endptr =3D (char *)xfs_dir2_block_leaf_p(btp); = + if (mp->m_nls) + nls_name =3D xfs_alloc_unicode_nls_name(); + /* * Loop over the data portion of the block. * Each object is a real entry (dep) or an unused one (dup). @@ -513,15 +519,24 @@ xfs_dir2_block_getdents( #if XFS_BIG_INUMS ino +=3D mp->m_inoadd; #endif + if (mp->m_nls) { + error =3D xfs_unicode_to_nls(mp->m_nls, dep->name, + dep->namelen, &nls_name, &nls_namelen); + if (error) { + xfs_da_brelse(NULL, bp); + return error; + } + } = /* * If it didn't fit, set the final offset to here & return. */ - if (filldir(dirent, dep->name, dep->namelen, cook, - ino, DT_UNKNOWN)) { + if (filldir(dirent, + nls_namelen ? nls_name : (char *)dep->name, + nls_namelen ? nls_namelen : dep->namelen, + cook, ino, DT_UNKNOWN)) { *offset =3D cook; - xfs_da_brelse(NULL, bp); - return 0; + goto out; } } = @@ -530,6 +545,9 @@ xfs_dir2_block_getdents( * Set the offset to a non-existent block 1 and return. */ *offset =3D xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0); +out: + if (mp->m_nls) + xfs_free_unicode_nls_name(nls_name); xfs_da_brelse(NULL, bp); return 0; } @@ -616,6 +634,14 @@ xfs_dir2_block_lookup( * Fill in inode number, release the block. */ args->inumber =3D be64_to_cpu(dep->inumber); + if (args->cmpresult =3D=3D XFS_CMP_CASE) { + error =3D xfs_unicode_to_nls(mp->m_nls, dep->name, dep->namelen, + (char **)&args->value, &args->valuelen); + if (error) { + xfs_da_brelse(args->trans, bp); + return XFS_ERROR(error); + } + } xfs_da_brelse(args->trans, bp); return XFS_ERROR(EEXIST); } @@ -643,6 +669,7 @@ xfs_dir2_block_lookup_int( int mid; /* binary search current idx */ xfs_mount_t *mp; /* filesystem mount point */ xfs_trans_t *tp; /* transaction pointer */ + xfs_dacmp_t cmp; /* comparison result */ = dp =3D args->dp; tp =3D args->trans; @@ -688,6 +715,7 @@ xfs_dir2_block_lookup_int( * Now loop forward through all the entries with the * right hash value looking for our name. */ + args->cmpresult =3D XFS_CMP_DIFFERENT; do { if ((addr =3D be32_to_cpu(blp[mid].address)) =3D=3D XFS_DIR2_NULL_DAT= APTR) continue; @@ -697,20 +725,34 @@ xfs_dir2_block_lookup_int( dep =3D (xfs_dir2_data_entry_t *) ((char *)block + xfs_dir2_dataptr_to_off(mp, addr)); /* - * Compare, if it's right give back buffer & entry number. - */ - if (dep->namelen =3D=3D args->namelen && - dep->name[0] =3D=3D args->name[0] && - memcmp(dep->name, args->name, args->namelen) =3D=3D 0) { + * Compare, if it's right give back buffer & entry number: + * + * lookup case - use nameops; + * + * replace/remove case - as lookup has been already been + * performed, look for an exact match using the fast method + */ + cmp =3D args->oknoent ? + xfs_dir_compname(dp, dep->name, dep->namelen, + args->name, args->namelen) : + xfs_default_compname(dp, dep->name, dep->namelen, + args->name, args->namelen); + if (cmp !=3D XFS_CMP_DIFFERENT && cmp !=3D args->cmpresult) { + args->cmpresult =3D cmp; *bpp =3D bp; *entno =3D mid; - return 0; + if (cmp =3D=3D XFS_CMP_EXACT) + return 0; } - } while (++mid < be32_to_cpu(btp->count) && be32_to_cpu(blp[mid].hashv= al) =3D=3D hash); + } while (++mid < be32_to_cpu(btp->count) && + be32_to_cpu(blp[mid].hashval) =3D=3D hash); + + ASSERT(args->oknoent); + if (args->cmpresult =3D=3D XFS_CMP_CASE) + return 0; /* * No match, release the buffer and return ENOENT. */ - ASSERT(args->oknoent); xfs_da_brelse(tp, bp); return XFS_ERROR(ENOENT); } @@ -1187,8 +1229,8 @@ xfs_dir2_sf_to_block( tagp =3D xfs_dir2_data_entry_tag_p(dep); *tagp =3D cpu_to_be16((char *)dep - (char *)block); xfs_dir2_data_log_entry(tp, bp, dep); - blp[2 + i].hashval =3D cpu_to_be32(xfs_da_hashname( - (char *)sfep->name, sfep->namelen)); + blp[2 + i].hashval =3D cpu_to_be32(xfs_dir_hashname(dp, + sfep->name, sfep->namelen)); blp[2 + i].address =3D cpu_to_be32(xfs_dir2_byte_to_dataptr(mp, (char *)dep - (char *)block)); offset =3D (int)((char *)(tagp + 1) - (char *)block); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_dir2_data.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_dir2_data.c 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/xfs_dir2_data.c 2008-01-21 14:33:22.540095423 +1100 @@ -140,7 +140,8 @@ xfs_dir2_data_check( addr =3D xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk, (xfs_dir2_data_aoff_t) ((char *)dep - (char *)d)); - hash =3D xfs_da_hashname((char *)dep->name, dep->namelen); + hash =3D xfs_dir_hashname(dp, (char *)dep->name, + dep->namelen); for (i =3D 0; i < be32_to_cpu(btp->count); i++) { if (be32_to_cpu(lep[i].address) =3D=3D addr && be32_to_cpu(lep[i].hashval) =3D=3D hash) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_dir2_leaf.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_dir2_leaf.c 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/xfs_dir2_leaf.c 2008-01-21 14:16:01.621460279 +1100 @@ -40,6 +40,7 @@ #include "xfs_dir2_node.h" #include "xfs_dir2_trace.h" #include "xfs_error.h" +#include "xfs_unicode.h" = /* * Local function declarations. @@ -780,6 +781,8 @@ xfs_dir2_leaf_getdents( int ra_offset; /* map entry offset for ra */ int ra_want; /* readahead count wanted */ xfs_ino_t ino; + char *nls_name =3D NULL; /* NLS name buffer */ + int nls_namelen =3D 0; = /* * If the offset is at or past the largest allowed value, @@ -800,6 +803,9 @@ xfs_dir2_leaf_getdents( map_valid =3D ra_index =3D ra_offset =3D ra_current =3D map_blocks =3D= 0; bp =3D NULL; = + if (mp->m_nls) + nls_name =3D xfs_alloc_unicode_nls_name(); + /* * Inside the loop we keep the main offset value as a byte offset * in the directory file. @@ -1086,13 +1092,21 @@ xfs_dir2_leaf_getdents( #if XFS_BIG_INUMS ino +=3D mp->m_inoadd; #endif + if (mp->m_nls) { + error =3D xfs_unicode_to_nls(mp->m_nls, dep->name, + dep->namelen, &nls_name, &nls_namelen); + if (error) + break; + } = /* * Won't fit. Return to caller. */ - if (filldir(dirent, dep->name, dep->namelen, - xfs_dir2_byte_to_dataptr(mp, curoff), - ino, DT_UNKNOWN)) + if (filldir(dirent, + nls_namelen ? nls_name : (char *)dep->name, + nls_namelen ? nls_namelen : dep->namelen, + xfs_dir2_byte_to_dataptr(mp, curoff), + ino, DT_UNKNOWN)) break; = /* @@ -1113,6 +1127,8 @@ xfs_dir2_leaf_getdents( kmem_free(map, map_size * sizeof(*map)); if (bp) xfs_da_brelse(NULL, bp); + if (mp->m_nls) + xfs_free_unicode_nls_name(nls_name); return error; } = @@ -1300,10 +1316,18 @@ xfs_dir2_leaf_lookup( /* * Return the found inode number. */ + error =3D EEXIST; args->inumber =3D be64_to_cpu(dep->inumber); + if (args->cmpresult =3D=3D XFS_CMP_CASE) { + error =3D xfs_unicode_to_nls(args->dp->i_mount->m_nls, + dep->name, dep->namelen, + (char **)&args->value, &args->valuelen); + if (!error) + error =3D EEXIST; + } xfs_da_brelse(tp, dbp); xfs_da_brelse(tp, lbp); - return XFS_ERROR(EEXIST); + return XFS_ERROR(error); } = /* @@ -1331,6 +1355,7 @@ xfs_dir2_leaf_lookup_int( xfs_mount_t *mp; /* filesystem mount point */ xfs_dir2_db_t newdb; /* new data block number */ xfs_trans_t *tp; /* transaction pointer */ + xfs_dacmp_t cmp; /* name compare result */ = dp =3D args->dp; tp =3D args->trans; @@ -1354,6 +1379,7 @@ xfs_dir2_leaf_lookup_int( * Loop over all the entries with the right hash value * looking to match the name. */ + args->cmpresult =3D XFS_CMP_DIFFERENT; for (lep =3D &leaf->ents[index], dbp =3D NULL, curdb =3D -1; index < be16_to_cpu(leaf->hdr.count) && be32_to_cpu(lep->hashval)= =3D=3D args->hashval; lep++, index++) { @@ -1391,19 +1417,31 @@ xfs_dir2_leaf_lookup_int( xfs_dir2_dataptr_to_off(mp, be32_to_cpu(lep->address))); /* * If it matches then return it. - */ - if (dep->namelen =3D=3D args->namelen && - dep->name[0] =3D=3D args->name[0] && - memcmp(dep->name, args->name, args->namelen) =3D=3D 0) { + * + * lookup case - use nameops; + * + * replace/remove case - as lookup has been already been + * performed, look for an exact match using the fast method + */ + cmp =3D args->oknoent ? + xfs_dir_compname(dp, dep->name, dep->namelen, + args->name, args->namelen) : + xfs_default_compname(dp, dep->name, dep->namelen, + args->name, args->namelen); + if (cmp !=3D XFS_CMP_DIFFERENT && cmp !=3D args->cmpresult) { + args->cmpresult =3D cmp; *dbpp =3D dbp; *indexp =3D index; - return 0; + if (cmp =3D=3D XFS_CMP_EXACT) + return 0; } } + ASSERT(args->oknoent); + if (args->cmpresult =3D=3D XFS_CMP_CASE) + return 0; /* * No match found, return ENOENT. */ - ASSERT(args->oknoent); if (dbp) xfs_da_brelse(tp, dbp); xfs_da_brelse(tp, lbp); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_dir2_node.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_dir2_node.c 2008-01-21 14:42:50.000000000 +1100 +++ b/fs/xfs/xfs_dir2_node.c 2008-01-21 14:35:07.954595095 +1100 @@ -39,6 +39,7 @@ #include "xfs_dir2_node.h" #include "xfs_dir2_trace.h" #include "xfs_error.h" +#include "xfs_unicode.h" = /* * Function declarations. @@ -414,6 +415,7 @@ xfs_dir2_leafn_lookup_int( xfs_dir2_db_t newdb; /* new data block number */ xfs_dir2_db_t newfdb; /* new free block number */ xfs_trans_t *tp; /* transaction pointer */ + xfs_dacmp_t cmp; /* comparison result */ = dp =3D args->dp; tp =3D args->trans; @@ -455,6 +457,7 @@ xfs_dir2_leafn_lookup_int( /* * Loop over leaf entries with the right hash value. */ + args->cmpresult =3D XFS_CMP_DIFFERENT; for (lep =3D &leaf->ents[index]; index < be16_to_cpu(leaf->hdr.count) && be32_to_cpu(lep->hashval)= =3D=3D args->hashval; lep++, index++) { @@ -572,28 +575,36 @@ xfs_dir2_leafn_lookup_int( /* * Point to the data entry. */ - dep =3D (xfs_dir2_data_entry_t *) - ((char *)curbp->data + - xfs_dir2_dataptr_to_off(mp, be32_to_cpu(lep->address))); + dep =3D (xfs_dir2_data_entry_t *)((char *)curbp->data + + xfs_dir2_dataptr_to_off(mp, + be32_to_cpu(lep->address))); /* * Compare the entry, return it if it matches. */ - if (dep->namelen =3D=3D args->namelen && - dep->name[0] =3D=3D args->name[0] && - memcmp(dep->name, args->name, args->namelen) =3D=3D 0) { + cmp =3D args->oknoent ? + xfs_dir_compname(dp, dep->name, dep->namelen, + args->name, args->namelen): + xfs_default_compname(dp, dep->name, + dep->namelen, args->name, + args->namelen); + if (cmp !=3D XFS_CMP_DIFFERENT && + cmp !=3D args->cmpresult) { + args->cmpresult =3D cmp; args->inumber =3D be64_to_cpu(dep->inumber); *indexp =3D index; state->extravalid =3D 1; state->extrablk.bp =3D curbp; state->extrablk.blkno =3D curdb; - state->extrablk.index =3D - (int)((char *)dep - - (char *)curbp->data); + state->extrablk.index =3D (int)((char *)dep - + (char *)curbp->data); state->extrablk.magic =3D XFS_DIR2_DATA_MAGIC; - return XFS_ERROR(EEXIST); + if (cmp =3D=3D XFS_CMP_EXACT) + return XFS_ERROR(EEXIST); } } } + if (args->cmpresult =3D=3D XFS_CMP_CASE) + return XFS_ERROR(EEXIST); /* * Didn't find a match. * If we are holding a buffer, give it back in case our caller @@ -823,16 +834,17 @@ xfs_dir2_leafn_rebalance( */ if (!state->inleaf) blk2->index =3D blk1->index - be16_to_cpu(leaf1->hdr.count); - = - /* = - * Finally sanity check just to make sure we are not returning a negat= ive index = + + /* + * Finally sanity check just to make sure we are not returning a + * negative index */ if(blk2->index < 0) { state->inleaf =3D 1; blk2->index =3D 0; cmn_err(CE_ALERT, - "xfs_dir2_leafn_rebalance: picked the wrong leaf? reverting original= leaf: " - "blk1->index %d\n", + "xfs_dir2_leafn_rebalance: picked the wrong leaf? " + "reverting original leaf: blk1->index %d\n", blk1->index); } } @@ -1768,6 +1780,20 @@ xfs_dir2_node_lookup( if (error) rval =3D error; /* + * If case-insens match, copy name out + */ + if (args->cmpresult =3D=3D XFS_CMP_CASE) { + xfs_dir2_data_entry_t *dep =3D + (xfs_dir2_data_entry_t *) + ((char *)state->extrablk.bp->data + + state->extrablk.index); + error =3D xfs_unicode_to_nls(args->dp->i_mount->m_nls, + dep->name, dep->namelen, + (char **)&args->value, &args->valuelen); + if (error) + rval =3D error; + } + /* * Release the btree blocks and leaf block. */ for (i =3D 0; i < state->path.active; i++) { =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_dir2_sf.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_dir2_sf.c 2008-01-21 14:42:51.000000000 +1100 +++ b/fs/xfs/xfs_dir2_sf.c 2008-01-21 14:21:42.201792024 +1100 @@ -38,6 +38,7 @@ #include "xfs_dir2_leaf.h" #include "xfs_dir2_block.h" #include "xfs_dir2_trace.h" +#include "xfs_unicode.h" = /* * Prototypes for internal functions. @@ -701,6 +702,7 @@ xfs_dir2_sf_getdents( filldir_t filldir) { int i; /* shortform entry number */ + int error =3D 0; xfs_mount_t *mp; /* filesystem mount point */ xfs_dir2_dataptr_t off; /* current entry's offset */ xfs_dir2_sf_entry_t *sfep; /* shortform directory entry */ @@ -708,6 +710,8 @@ xfs_dir2_sf_getdents( xfs_dir2_dataptr_t dot_offset; xfs_dir2_dataptr_t dotdot_offset; xfs_ino_t ino; + char *nls_name =3D NULL; /* NLS name buffer */ + int nls_namelen =3D 0; = mp =3D dp->i_mount; = @@ -772,6 +776,9 @@ xfs_dir2_sf_getdents( } } = + if (mp->m_nls) + nls_name =3D xfs_alloc_unicode_nls_name(); + /* * Loop while there are more entries and put'ing works. */ @@ -789,17 +796,26 @@ xfs_dir2_sf_getdents( #if XFS_BIG_INUMS ino +=3D mp->m_inoadd; #endif - - if (filldir(dirent, sfep->name, sfep->namelen, - off, ino, DT_UNKNOWN)) { + if (mp->m_nls) { + error =3D xfs_unicode_to_nls(mp->m_nls, sfep->name, + sfep->namelen, &nls_name, &nls_namelen); + if (error) + goto out; + } + if (filldir(dirent, + nls_namelen ? nls_name : (char *)sfep->name, + nls_namelen ? nls_namelen : sfep->namelen, + off, ino, DT_UNKNOWN)) { *offset =3D off; - return 0; + goto out; } sfep =3D xfs_dir2_sf_nextentry(sfp, sfep); } - *offset =3D xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0); - return 0; +out: + if (mp->m_nls) + xfs_free_unicode_nls_name(nls_name); + return error; } = /* @@ -812,6 +828,7 @@ xfs_dir2_sf_lookup( { xfs_inode_t *dp; /* incore directory inode */ int i; /* entry index */ + int error; xfs_dir2_sf_entry_t *sfep; /* shortform directory entry */ xfs_dir2_sf_t *sfp; /* shortform structure */ = @@ -836,6 +853,7 @@ xfs_dir2_sf_lookup( */ if (args->namelen =3D=3D 1 && args->name[0] =3D=3D '.') { args->inumber =3D dp->i_ino; + args->cmpresult =3D XFS_CMP_EXACT; return XFS_ERROR(EEXIST); } /* @@ -844,23 +862,44 @@ xfs_dir2_sf_lookup( if (args->namelen =3D=3D 2 && args->name[0] =3D=3D '.' && args->name[1] =3D=3D '.') { args->inumber =3D xfs_dir2_sf_get_inumber(sfp, &sfp->hdr.parent); + args->cmpresult =3D XFS_CMP_EXACT; return XFS_ERROR(EEXIST); } /* * Loop over all the entries trying to match ours. */ - for (i =3D 0, sfep =3D xfs_dir2_sf_firstentry(sfp); - i < sfp->hdr.count; - i++, sfep =3D xfs_dir2_sf_nextentry(sfp, sfep)) { - if (sfep->namelen =3D=3D args->namelen && - sfep->name[0] =3D=3D args->name[0] && - memcmp(args->name, sfep->name, args->namelen) =3D=3D 0) { - args->inumber =3D - xfs_dir2_sf_get_inumber(sfp, - xfs_dir2_sf_inumberp(sfep)); + args->cmpresult =3D XFS_CMP_DIFFERENT; + for (i =3D 0, sfep =3D xfs_dir2_sf_firstentry(sfp); i < sfp->hdr.count= ; + i++, sfep =3D xfs_dir2_sf_nextentry(sfp, sfep)) { + switch (xfs_dir_compname(dp, sfep->name, sfep->namelen, + args->name, args->namelen)) { + case XFS_CMP_EXACT: + args->cmpresult =3D XFS_CMP_EXACT; + args->inumber =3D xfs_dir2_sf_get_inumber(sfp, + xfs_dir2_sf_inumberp(sfep)); + if (args->value) { + xfs_free_unicode_nls_name(args->value); + args->value =3D NULL; + } return XFS_ERROR(EEXIST); + + case XFS_CMP_CASE: + if (!args->value) { + error =3D xfs_unicode_to_nls( + args->dp->i_mount->m_nls, sfep->name, + sfep->namelen, (char **)&args->value, + &args->valuelen); + if (error) + return XFS_ERROR(error); + args->cmpresult =3D XFS_CMP_CASE; + args->inumber =3D xfs_dir2_sf_get_inumber(sfp, + xfs_dir2_sf_inumberp(sfep)); + } + default: ; } } + if (args->cmpresult =3D=3D XFS_CMP_CASE) + return XFS_ERROR(EEXIST); /* * Didn't find it. */ @@ -907,9 +946,8 @@ xfs_dir2_sf_removename( for (i =3D 0, sfep =3D xfs_dir2_sf_firstentry(sfp); i < sfp->hdr.count; i++, sfep =3D xfs_dir2_sf_nextentry(sfp, sfep)) { - if (sfep->namelen =3D=3D args->namelen && - sfep->name[0] =3D=3D args->name[0] && - memcmp(sfep->name, args->name, args->namelen) =3D=3D 0) { + if (xfs_default_compname(dp, sfep->name, sfep->namelen, + args->name, args->namelen) =3D=3D XFS_CMP_EXACT) { ASSERT(xfs_dir2_sf_get_inumber(sfp, xfs_dir2_sf_inumberp(sfep)) =3D=3D args->inumber); @@ -1044,9 +1082,9 @@ xfs_dir2_sf_replace( for (i =3D 0, sfep =3D xfs_dir2_sf_firstentry(sfp); i < sfp->hdr.count; i++, sfep =3D xfs_dir2_sf_nextentry(sfp, sfep)) { - if (sfep->namelen =3D=3D args->namelen && - sfep->name[0] =3D=3D args->name[0] && - memcmp(args->name, sfep->name, args->namelen) =3D=3D 0) { + if (xfs_default_compname(dp, sfep->name, + sfep->namelen, args->name, + args->namelen) =3D=3D XFS_CMP_EXACT) { #if XFS_BIG_INUMS || defined(DEBUG) ino =3D xfs_dir2_sf_get_inumber(sfp, xfs_dir2_sf_inumberp(sfep)); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_itable.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_itable.c 2008-01-21 14:42:51.000000000 +1100 +++ b/fs/xfs/xfs_itable.c 2008-01-18 13:45:10.740061749 +1100 @@ -45,6 +45,8 @@ xfs_internal_inum( xfs_ino_t ino) { return (ino =3D=3D mp->m_sb.sb_rbmino || ino =3D=3D mp->m_sb.sb_rsumin= o || + (xfs_sb_version_hasunicode(&mp->m_sb) && + ino =3D=3D mp->m_sb.sb_cftino) || (XFS_SB_VERSION_HASQUOTA(&mp->m_sb) && (ino =3D=3D mp->m_sb.sb_uquotino || ino =3D=3D mp->m_sb.sb_gquotino)= )); } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_mount.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_mount.c 2008-01-21 14:42:51.000000000 +1100 +++ b/fs/xfs/xfs_mount.c 2008-01-21 14:27:33.000000000 +1100 @@ -25,6 +25,7 @@ #include "xfs_sb.h" #include "xfs_ag.h" #include "xfs_dir2.h" +#include "xfs_attr.h" #include "xfs_dmapi.h" #include "xfs_mount.h" #include "xfs_bmap_btree.h" @@ -43,6 +44,9 @@ #include "xfs_rw.h" #include "xfs_quota.h" #include "xfs_fsops.h" +#include "xfs_da_btree.h" +#include "xfs_attr_leaf.h" +#include "xfs_unicode.h" = STATIC void xfs_mount_log_sbunit(xfs_mount_t *, __int64_t); STATIC int xfs_uuid_mount(xfs_mount_t *); @@ -119,6 +123,8 @@ static const struct { { offsetof(xfs_sb_t, sb_logsectsize),0 }, { offsetof(xfs_sb_t, sb_logsunit), 0 }, { offsetof(xfs_sb_t, sb_features2), 0 }, + { offsetof(xfs_sb_t, sb_bad_features2), 0 }, + { offsetof(xfs_sb_t, sb_cftino), 0 }, { sizeof(xfs_sb_t), 0 } }; = @@ -165,6 +171,9 @@ xfs_mount_free( sizeof(xfs_perag_t) * mp->m_sb.sb_agcount); } = + if (mp->m_cft) + xfs_unicode_free_cft(mp->m_cft); + spinlock_destroy(&mp->m_ail_lock); spinlock_destroy(&mp->m_sb_lock); mutex_destroy(&mp->m_ilock); @@ -449,6 +458,8 @@ xfs_sb_from_disk( to->sb_logsectsize =3D be16_to_cpu(from->sb_logsectsize); to->sb_logsunit =3D be32_to_cpu(from->sb_logsunit); to->sb_features2 =3D be32_to_cpu(from->sb_features2); + to->sb_bad_features2 =3D be32_to_cpu(from->sb_bad_features2); + to->sb_cftino =3D be64_to_cpu(from->sb_cftino); } = /* @@ -1056,7 +1067,7 @@ xfs_mountfs( /* * Initialize the attribute manager's entries. */ - mp->m_attr_magicpct =3D (mp->m_sb.sb_blocksize * 37) / 100; + xfs_attr_mount(mp); = /* * Initialize the precomputed transaction reservations values. @@ -1159,6 +1170,18 @@ xfs_mountfs( } = /* + * Load in unicode case folding table from disk + */ + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + error =3D xfs_unicode_read_cft(mp); + if (error) { + cmn_err(CE_WARN, + "XFS: failed to read case folding table"); + goto error4; + } + } + + /* * If fs is not mounted readonly, then update the superblock * unit and width changes. */ @@ -1214,6 +1237,8 @@ xfs_mountfs( * Free up the root inode. */ VN_RELE(rvp); + if (mp->m_cft) + xfs_unicode_free_cft(mp->m_cft); error3: xfs_log_unmount_dealloc(mp); error2: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_mount.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_mount.h 2008-01-21 14:42:51.000000000 +1100 +++ b/fs/xfs/xfs_mount.h 2008-01-21 14:27:33.000000000 +1100 @@ -54,6 +54,7 @@ typedef struct xfs_trans_reservations { #else struct cred; struct log; +struct nls_table; struct xfs_mount_args; struct xfs_inode; struct xfs_bmbt_irec; @@ -61,6 +62,8 @@ struct xfs_bmap_free; struct xfs_extdelta; struct xfs_swapext; struct xfs_mru_cache; +struct xfs_nameops; +struct xfs_cft; = /* * Prototypes and functions for the Data Migration subsystem. @@ -312,6 +315,10 @@ typedef struct xfs_mount { __uint8_t m_inode_quiesce;/* call quiesce on new inodes. field governed by m_ilock */ __uint8_t m_sectbb_log; /* sectlog - BBSHIFT */ + const struct xfs_nameops *m_dirnameops; /* vector of dir name ops */ + const struct xfs_nameops *m_attrnameops; /* vector of attr name ops */= + const struct xfs_cft *m_cft; /* unicode case fold table */ + struct nls_table *m_nls; /* active NLS table */ int m_dirblksize; /* directory block sz--bytes */ int m_dirblkfsbs; /* directory block sz--fsbs */ xfs_dablk_t m_dirdatablk; /* blockno of dir data v2 */ @@ -377,7 +384,10 @@ typedef struct xfs_mount { counters */ #define XFS_MOUNT_FILESTREAMS (1ULL << 24) /* enable the filestreams allocator */ - +#define XFS_MOUNT_CI_LOOKUP (1ULL << 25) /* enable case-insensitive + * file lookup */ +#define XFS_MOUNT_CI_ATTR (1ULL << 26) /* enable case-insensitive + attribute names */ = /* * Default minimum read and write sizes. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_rename.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_rename.c 2008-01-21 14:42:51.000000000 +1100 +++ b/fs/xfs/xfs_rename.c 2008-01-17 12:25:31.652529581 +1100 @@ -130,7 +130,9 @@ xfs_lock_for_rename( lock_mode =3D xfs_ilock_map_shared(dp2); } = - error =3D xfs_dir_lookup_int(dp2, lock_mode, vname2, &inum2, &ip2); + error =3D xfs_dir_lookup_int(dp2, lock_mode, vname2, &inum2, &ip2, + NULL, NULL); + if (error =3D=3D ENOENT) { /* target does not need to exist. */ inum2 =3D 0; } else if (error) { @@ -214,6 +216,7 @@ xfs_lock_for_rename( for (;i < 4; i++) { i_tab[i] =3D NULL; } + return 0; } = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_sb.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_sb.h 2008-01-21 14:42:51.000000000 +1100 +++ b/fs/xfs/xfs_sb.h 2008-01-21 14:41:29.721741469 +1100 @@ -46,10 +46,12 @@ struct xfs_mount; #define XFS_SB_VERSION_SECTORBIT 0x0800 #define XFS_SB_VERSION_EXTFLGBIT 0x1000 #define XFS_SB_VERSION_DIRV2BIT 0x2000 +#define XFS_SB_VERSION_OLDCIBIT 0x4000 /* ASCII only case-insens. */ #define XFS_SB_VERSION_MOREBITSBIT 0x8000 #define XFS_SB_VERSION_OKSASHFBITS \ (XFS_SB_VERSION_EXTFLGBIT | \ - XFS_SB_VERSION_DIRV2BIT) + XFS_SB_VERSION_DIRV2BIT | \ + XFS_SB_VERSION_OLDCIBIT) #define XFS_SB_VERSION_OKREALFBITS \ (XFS_SB_VERSION_ATTRBIT | \ XFS_SB_VERSION_NLINKBIT | \ @@ -77,10 +79,12 @@ struct xfs_mount; #define XFS_SB_VERSION2_LAZYSBCOUNTBIT 0x00000002 /* Superblk counters = */ #define XFS_SB_VERSION2_RESERVED4BIT 0x00000004 #define XFS_SB_VERSION2_ATTR2BIT 0x00000008 /* Inline attr rework */ +#define XFS_SB_VERSION2_UNICODEBIT 0x00000020 /* Unicode names */ = #define XFS_SB_VERSION2_OKREALFBITS \ (XFS_SB_VERSION2_LAZYSBCOUNTBIT | \ - XFS_SB_VERSION2_ATTR2BIT) + XFS_SB_VERSION2_ATTR2BIT | \ + XFS_SB_VERSION2_UNICODEBIT) #define XFS_SB_VERSION2_OKSASHFBITS \ (0) #define XFS_SB_VERSION2_OKREALBITS \ @@ -145,6 +149,9 @@ typedef struct xfs_sb { __uint16_t sb_logsectsize; /* sector size for the log, bytes */ __uint32_t sb_logsunit; /* stripe unit size for the log */ __uint32_t sb_features2; /* additional feature bits */ + __uint32_t sb_bad_features2; /* bad mkfs set features2 here */ + xfs_ino_t sb_cftino; /* unicode case folding table inode */ + /* must be padded to 64 bit alignment */ } xfs_sb_t; = /* @@ -205,6 +212,9 @@ typedef struct xfs_dsb { __be16 sb_logsectsize; /* sector size for the log, bytes */ __be32 sb_logsunit; /* stripe unit size for the log */ __be32 sb_features2; /* additional feature bits */ + __be32 sb_bad_features2; /* bad mkfs set features2 here */ + __be64 sb_cftino; /* unicode case folding table inode */ + /* must be padded to 64 bit alignment */ } xfs_dsb_t; = /* @@ -223,7 +233,7 @@ typedef enum { XFS_SBS_GQUOTINO, XFS_SBS_QFLAGS, XFS_SBS_FLAGS, XFS_SBS_SHARED_VN, XFS_SBS_INOALIGNMT, XFS_SBS_UNIT, XFS_SBS_WIDTH, XFS_SBS_DIRBLKLOG, XFS_SBS_LOGSECTLOG, XFS_SBS_LOGSECTSIZE, XFS_SBS_LOGSUNIT, - XFS_SBS_FEATURES2, + XFS_SBS_FEATURES2, XFS_SBS_BAD_FEATURES2, XFS_SBS_CFTINO, XFS_SBS_FIELDCOUNT } xfs_sb_field_t; = @@ -248,13 +258,15 @@ typedef enum { #define XFS_SB_IFREE XFS_SB_MVAL(IFREE) #define XFS_SB_FDBLOCKS XFS_SB_MVAL(FDBLOCKS) #define XFS_SB_FEATURES2 XFS_SB_MVAL(FEATURES2) +#define XFS_SB_CASEFOLDINO XFS_SB_MVAL(CASEFOLDINO) #define XFS_SB_NUM_BITS ((int)XFS_SBS_FIELDCOUNT) #define XFS_SB_ALL_BITS ((1LL << XFS_SB_NUM_BITS) - 1) #define XFS_SB_MOD_BITS \ (XFS_SB_UUID | XFS_SB_ROOTINO | XFS_SB_RBMINO | XFS_SB_RSUMINO | \ XFS_SB_VERSIONNUM | XFS_SB_UQUOTINO | XFS_SB_GQUOTINO | \ XFS_SB_QFLAGS | XFS_SB_SHARED_VN | XFS_SB_UNIT | XFS_SB_WIDTH | \ - XFS_SB_ICOUNT | XFS_SB_IFREE | XFS_SB_FDBLOCKS | XFS_SB_FEATURES2) + XFS_SB_ICOUNT | XFS_SB_IFREE | XFS_SB_FDBLOCKS | XFS_SB_FEATURES2 | \= + XFS_SB_CFTINO) = = /* @@ -463,6 +475,12 @@ static inline int xfs_sb_version_hassect ((sbp)->sb_versionnum & XFS_SB_VERSION_SECTORBIT); } = +static inline int xfs_sb_version_hasoldci(xfs_sb_t *sbp) +{ + return (XFS_SB_VERSION_NUM(sbp) =3D=3D XFS_SB_VERSION_4) && \ + ((sbp)->sb_versionnum & XFS_SB_VERSION_OLDCIBIT); +} + #define XFS_SB_VERSION_HASMOREBITS(sbp) xfs_sb_version_hasmorebits(sbp)= static inline int xfs_sb_version_hasmorebits(xfs_sb_t *sbp) { @@ -502,6 +520,13 @@ static inline void xfs_sb_version_addatt ((sbp)->sb_features2 | XFS_SB_VERSION2_ATTR2BIT))); } = +static inline int xfs_sb_version_hasunicode(xfs_sb_t *sbp) +{ + return (xfs_sb_version_hasmorebits(sbp) && \ + ((sbp)->sb_features2 & XFS_SB_VERSION2_UNICODEBIT)); +} + + /* * end of superblock version macros */ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_unicode.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_unicode.c 2006-06-17 00:58:24.000000000 +1000 +++ b/fs/xfs/xfs_unicode.c 2008-01-21 14:10:29.048257871 +1100 @@ -0,0 +1,530 @@ +/* + * Copyright (c) 2007 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation,= + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "xfs.h" +#include "xfs_fs.h" +#include "xfs_bit.h" +#include "xfs_log.h" +#include "xfs_inum.h" +#include "xfs_clnt.h" +#include "xfs_trans.h" +#include "xfs_sb.h" +#include "xfs_ag.h" +#include "xfs_dir2.h" +#include "xfs_alloc.h" +#include "xfs_dmapi.h" +#include "xfs_mount.h" +#include "xfs_bmap_btree.h" +#include "xfs_alloc_btree.h" +#include "xfs_ialloc_btree.h" +#include "xfs_dir2_sf.h" +#include "xfs_attr_sf.h" +#include "xfs_dinode.h" +#include "xfs_inode.h" +#include "xfs_btree.h" +#include "xfs_ialloc.h" +#include "xfs_itable.h" +#include "xfs_rtalloc.h" +#include "xfs_error.h" +#include "xfs_bmap.h" +#include "xfs_rw.h" +#include "xfs_unicode.h" + +#define MAX_FOLD_CHARS 4 + +static kmem_zone_t *xfs_nls_uni_zone; + +static inline int +xfs_casefold( + const xfs_cft_t *cft, + __uint16_t c, + __uint16_t *fc) +{ + __uint16_t *table =3D XFS_CFT_PTR(cft, 0); + __uint16_t tmp =3D table[c >> 8]; + int i; + + if (!tmp) { + *fc =3D c; + return 1; + } + tmp =3D table[tmp + (c & 0xff)]; + if ((tmp & 0xf000) !=3D 0xe000) { + *fc =3D tmp; + return 1; + } + i =3D ((tmp >> 10) & 0x3) + 2; + ASSERT(i < cft->num_tables); + table =3D XFS_CFT_PTR(cft, i - 1) + ((tmp & 0x3ff) * i); + + memcpy(fc, table, sizeof(__uint16_t) * i); + + return i; +} + +static inline int +xfs_utf8_casefold( + const xfs_cft_t *cft, + const uchar_t **name, + int *namelen, + __uint16_t *fc) +{ + wchar_t uc; + + if (*namelen =3D=3D 0) + return 0; + + if (**name & 0x80) { + int n =3D utf8_mbtowc(&uc, *name, *namelen); + if (n < 0) { + (*namelen)--; + *fc =3D *(*name)++; + return 1; + } + *name +=3D n; + *namelen -=3D n; + } else { + uc =3D *(*name)++; + (*namelen)--; + } + return xfs_casefold(cft, uc, fc); +} + +__uint32_t +xfs_unicode_hash( + const xfs_cft_t *cft, + const uchar_t *name, + int namelen) +{ + __uint32_t hash =3D 0; + __uint16_t fc[MAX_FOLD_CHARS]; + int nfc; + int i; + + while (namelen > 0) { + nfc =3D xfs_utf8_casefold(cft, &name, &namelen, fc); + for (i =3D 0; i < nfc; i++) + hash =3D fc[i] ^ rol32(hash, 7); + } + return hash; +} + +int +xfs_unicode_casecmp( + const xfs_cft_t *cft, + const uchar_t *name1, + int len1, + const uchar_t *name2, + int len2) +{ + __uint16_t fc1[MAX_FOLD_CHARS], fc2[MAX_FOLD_CHARS]; + __uint16_t *pfc1, *pfc2; + int nfc1, nfc2; + + nfc1 =3D xfs_utf8_casefold(cft, &name1, &len1, fc1); + pfc1 =3D fc1; + nfc2 =3D xfs_utf8_casefold(cft, &name2, &len2, fc2); + pfc2 =3D fc2; + + while (nfc1 > 0 && nfc2 > 0) { + if (*pfc1 !=3D *pfc2) + return (*pfc1 < *pfc2) ? -1 : 1; + if (!--nfc1) { + nfc1 =3D xfs_utf8_casefold(cft, &name1, &len1, fc1); + pfc1 =3D fc1; + } else + pfc1++; + if (!--nfc2) { + nfc2 =3D xfs_utf8_casefold(cft, &name2, &len2, fc2); + pfc2 =3D fc2; + } else + pfc2++; + } + if (nfc1 !=3D nfc2) + return (nfc1 < nfc2) ? -1 : 1; + return 0; +} + + +char * +xfs_alloc_unicode_nls_name(void) +{ + return kmem_zone_alloc(xfs_nls_uni_zone, KM_SLEEP); +} + + +void +xfs_free_unicode_nls_name( + char *name) +{ + kmem_zone_free(xfs_nls_uni_zone, name); +} + +int +xfs_nls_to_unicode( + struct nls_table *nls, + const char *nls_name, + int nls_namelen, + char **uni_name, + int *uni_namelen) +{ + char *n; + int i, o; + wchar_t uc; + int nlen; + int u8len; + int error =3D 0; + + n =3D *uni_name ? *uni_name : xfs_alloc_unicode_nls_name(); + + if (!nls) { + if (nls_namelen > MAXNAMELEN) { + error =3D ENAMETOOLONG; + goto err_out; + } + memcpy(n, nls_name, nls_namelen); + *uni_name =3D n; + *uni_namelen =3D nls_namelen; + return 0; + } + + for (i =3D 0, o =3D 0; i < nls_namelen; i +=3D nlen, o +=3D u8len) { + nlen =3D nls->char2uni(nls_name + i, nls_namelen - i, &uc); + if (nlen < 0) { + error =3D -nlen; + goto err_out; + } + if (uc >=3D 0xfffe || (uc >=3D 0xd800 && uc <=3D 0xdfff)) { + error =3D EINVAL; /* don't support chars outside BMP */ + goto err_out; + } + u8len =3D utf8_wctomb(n + o, uc, MAXNAMELEN - o); + if (u8len <=3D 0) { + error =3D (MAXNAMELEN - o < 3) ? ENAMETOOLONG : EINVAL; + goto err_out; + } + } + *uni_name =3D n; + *uni_namelen =3D o; + return 0; +err_out: + if (*uni_name =3D=3D NULL) + xfs_free_unicode_nls_name(n); + return error; +} + +int +xfs_unicode_to_nls( + struct nls_table *nls, + const char *uni_name, + int uni_namelen, + char **nls_name, + int *nls_namelen) +{ + char *n; + int i, o; + wchar_t uc; + int nlen; + int u8len; + int error =3D 0; + + n =3D *nls_name ? *nls_name : xfs_alloc_unicode_nls_name(); + + if (!nls) { + if (uni_namelen > MAXNAMELEN) { + error =3D ENAMETOOLONG; + goto err_out; + } + memcpy(n, uni_name, uni_namelen); + *nls_name =3D n; + *nls_namelen =3D uni_namelen; + return 0; + } + + for (i =3D 0, o =3D 0; i < uni_namelen && o < MAXNAMELEN; + i +=3D u8len, o +=3D nlen) { + u8len =3D utf8_mbtowc(&uc, uni_name + i, uni_namelen - i); + if (u8len < 0) { + error =3D EINVAL; + goto err_out; + } + nlen =3D nls->uni2char(uc, n + o, MAXNAMELEN - o); + if (nlen =3D=3D -EINVAL) { + n[o] =3D '?'; + nlen =3D 1; + } else if (nlen < 0) { + error =3D -nlen; + goto err_out; + } + } + if (i =3D=3D uni_namelen) { + *nls_name =3D n; + *nls_namelen =3D o; + return 0; + } + + error =3D ENAMETOOLONG; +err_out: + if (*nls_name =3D=3D NULL) + xfs_free_unicode_nls_name(n); + return error; +} + +int +xfs_unicode_validate( + const uchar_t *name, + int namelen) +{ + wchar_t uc; + int i, nlen; + + for (i =3D 0; i < namelen; i +=3D nlen) { + if (*name >=3D 0xf0) { + cmn_err(CE_WARN, "xfs_unicode_validate: " + "UTF-8 char beyond U+FFFF\n"); + return EINVAL; + } + /* utf8_mbtowc must fail on overlong sequences too */ + nlen =3D utf8_mbtowc(&uc, name + i, namelen - i); + if (nlen < 0) { + cmn_err(CE_WARN, "xfs_unicode_validate: " + "invalid UTF-8 sequence\n"); + return EILSEQ; + } + /* check for invalid/surrogate/private unicode chars */ + if (uc >=3D 0xfffe || (uc >=3D 0xd800 && uc <=3D 0xf8ff)) { + cmn_err(CE_WARN, "xfs_unicode_validate: " + "unsupported UTF-8 char\n"); + return EINVAL; + } + } + return 0; +} + +/* + * Unicode Case Fold Table management + */ + +struct cft_item { + xfs_cft_t *table; + int size; + int refcount; +}; + +static mutex_t cft_lock; +static int cft_size; +static struct cft_item *cft_list; + +static xfs_cft_t * +add_cft( + xfs_dcft_t *dcft, + int size) +{ + int found =3D 0; + int i, j; + xfs_cft_t *cft; + __be16 *duc; + __uint16_t *uc; + + mutex_lock(&cft_lock); + + for (i =3D 0; i < cft_size; i++) { + if (cft_list[i].size !=3D size) + continue; + cft =3D cft_list[i].table; + if (cft->num_tables !=3D be32_to_cpu(dcft->num_tables) || + cft->flags !=3D be32_to_cpu(dcft->flags)) + continue; + found =3D 1; + for (j =3D 0; j < cft->num_tables; j++) { + if (cft->table_offset[j] !=3D + be32_to_cpu(dcft->table_offset[j])) { + found =3D 0; + break; + } + } + if (found) { + cft_list[i].refcount++; + mutex_unlock(&cft_lock); + return cft; + } + } + + cft =3D vmalloc(size); + if (!cft) { + mutex_unlock(&cft_lock); + return NULL; + } + cft->magic =3D be32_to_cpu(dcft->magic); + cft->flags =3D be32_to_cpu(dcft->flags); + cft->num_tables =3D be32_to_cpu(dcft->num_tables); + ASSERT(cft->num_tables <=3D MAX_FOLD_CHARS); + for (i =3D 0; i < cft->num_tables; i++) + cft->table_offset[i] =3D be32_to_cpu(dcft->table_offset[i]); + j =3D (size - cft->table_offset[0]) / sizeof(__uint16_t); + uc =3D XFS_CFT_PTR(cft, 0); + duc =3D XFS_DCFT_PTR(dcft, 0); + for (i =3D 0; i < j; i++) + uc[i] =3D be16_to_cpu(duc[i]); + + cft_list =3D kmem_realloc(cft_list, + (cft_size + 1) * sizeof(struct cft_item), + cft_size * sizeof(struct cft_item), KM_SLEEP); + cft_list[cft_size].table =3D cft; + cft_list[cft_size].size =3D size; + cft_list[cft_size].refcount =3D 1; + cft_size++; + + mutex_unlock(&cft_lock); + + return cft; +} + +static void +remove_cft( + const xfs_cft_t *cft) +{ + int i; + + mutex_lock(&cft_lock); + + for (i =3D 0; i < cft_size; i++) { + if (cft_list[i].table =3D=3D cft) { + ASSERT(cft_list[i].refcount > 0); + cft_list[i].refcount--; + break; + } + } + + mutex_unlock(&cft_lock); +} + + +int +xfs_unicode_read_cft( + xfs_mount_t *mp) +{ + int error; + xfs_inode_t *cftip; + int size; + int nfsb; + int nmap; + xfs_bmbt_irec_t *mapp; + int n; + int byte_cnt; + xfs_buf_t *bp; + char *table; + xfs_dcft_t *dcft; + + if (mp->m_sb.sb_cftino =3D=3D NULLFSINO || mp->m_sb.sb_cftino =3D=3D 0= ) + return EINVAL; + error =3D xfs_iget(mp, NULL, mp->m_sb.sb_cftino, 0, 0, &cftip, 0); + if (error) + return error; + ASSERT(cftip !=3D NULL); + + size =3D cftip->i_d.di_size; + nfsb =3D cftip->i_d.di_nblocks; + + table =3D vmalloc(size); + if (!table) { + xfs_iput(cftip, 0); + return ENOMEM; + } + dcft =3D (xfs_dcft_t *)table; + + nmap =3D nfsb; + mapp =3D kmem_alloc(nfsb * sizeof(xfs_bmbt_irec_t), KM_SLEEP); + + error =3D xfs_bmapi(NULL, cftip, 0, nfsb, 0, NULL, 0, mapp, &nmap, + NULL, NULL); + if (error) + goto out; + + for (n =3D 0; n < nmap; n++) { + byte_cnt =3D XFS_FSB_TO_B(mp, mapp[n].br_blockcount); + + error =3D xfs_read_buf(mp, mp->m_ddev_targp, + XFS_FSB_TO_DADDR(mp, mapp[n].br_startblock), + BTOBB(byte_cnt), 0, &bp); + if (error) + goto out; + + if (size < byte_cnt) + byte_cnt =3D size; + size -=3D byte_cnt; + memcpy(table, XFS_BUF_PTR(bp), byte_cnt); + table +=3D byte_cnt; + xfs_buf_relse(bp); + } + + /* verify case table read off disk */ + if (!uuid_equal(&dcft->uuid, &mp->m_sb.sb_uuid)) { + error =3D EINVAL; + goto out; + } + + /* clear UUID for in-memory copy/compare */ + memset(&dcft->uuid, 0, sizeof(dcft->uuid)); + + mp->m_cft =3D add_cft(dcft, cftip->i_d.di_size); + if (mp->m_cft =3D=3D NULL) + error =3D ENOMEM; + +out: + xfs_iput(cftip, 0); + kmem_free(mapp, nfsb * sizeof(xfs_bmbt_irec_t)); + vfree(dcft); + + return error; +} + +void +xfs_unicode_free_cft( + const xfs_cft_t *cft) +{ + remove_cft(cft); +} + +void +xfs_unicode_init(void) +{ + mutex_init(&cft_lock); + xfs_nls_uni_zone =3D kmem_zone_init(MAXNAMELEN, "xfs_nls_uni"); +} + +void +xfs_unicode_uninit(void) +{ + int i; + + mutex_lock(&cft_lock); + + for (i =3D 0; i < cft_size; i++) { + ASSERT(cft_list[i].refcount =3D=3D 0); + vfree(cft_list[i].table); + } + kmem_free(cft_list, cft_size * sizeof(struct cft_item)); + cft_size =3D 0; + cft_list =3D NULL; + + mutex_unlock(&cft_lock); + mutex_destroy(&cft_lock); + + kmem_zone_destroy(xfs_nls_uni_zone); +} =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_unicode.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_unicode.h 2006-06-17 00:58:24.000000000 +1000 +++ b/fs/xfs/xfs_unicode.h 2008-01-21 14:23:07.266899447 +1100 @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2007 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation,= + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#ifndef __XFS_UNICODE_H__ +#define __XFS_UNICODE_H__ + +#define XFS_CFT_MAGIC 0x58434654 /* 'XCFT' */ +#define XFS_CFT_FLAG_TURKIC 0x00000001 +#define XFS_CFT_FLAG_MAX 0x00000001 + +/* + * Case Fold Table - on disk version. Must match the incore version bel= ow. + */ +typedef struct xfs_dcft { + __be32 magic; /* validity check */ + __be32 flags; + uuid_t uuid; /* UUID of the filesystem */ + __be32 crc; /* for future support */ + __be32 num_tables; /* single, double, etc */ + __be32 table_offset[1]; +} xfs_dcft_t; + +/* + * Case Fold Table - in core version. Must match the ondisk version abo= ve. + */ +typedef struct xfs_cft { + __uint32_t magic; + __uint32_t flags; + uuid_t uuid; /* UUID of the filesystem */ + __uint32_t crc; + __uint32_t num_tables; /* single, double, etc */ + __uint32_t table_offset[1];/* num_tables sized */ + /* 16-bit array tables immediately follow */ +} xfs_cft_t; + +#define XFS_CFT_PTR(t,n) (__uint16_t *)(((char *)(t)) + \ + (t)->table_offset[n]) +#define XFS_DCFT_PTR(t,n) (__be16 *)(((char *)(t)) + \ + be32_to_cpu((t)->table_offset[n])) + +void xfs_unicode_init(void); +void xfs_unicode_uninit(void); + +__uint32_t xfs_unicode_hash(const xfs_cft_t *cft, + const uchar_t *name, int namelen); + +int xfs_unicode_casecmp(const xfs_cft_t *cft, const uchar_t *name1, + int len1, const uchar_t *name2, int len2); + +char *xfs_alloc_unicode_nls_name(void); +void xfs_free_unicode_nls_name(char *name); +int xfs_nls_to_unicode(struct nls_table *nls, const char *nls_name, + int nls_namelen, char **uni_name, int *uni_namelen); +int xfs_unicode_to_nls(struct nls_table *nls, const char *uni_name, + int uni_namelen, char **nls_name, int *nls_namelen); + +int xfs_unicode_validate(const uchar_t *name, int namelen); + +int xfs_unicode_read_cft(struct xfs_mount *mp); +void xfs_unicode_free_cft(const xfs_cft_t *cft); + +#endif /* __XFS_UNICODE_H__ */ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_utils.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_utils.c 2008-01-21 14:42:51.000000000 +1100 +++ b/fs/xfs/xfs_utils.c 2007-10-26 15:42:04.856766756 +1000 @@ -39,6 +39,7 @@ #include "xfs_rw.h" #include "xfs_itable.h" #include "xfs_utils.h" +#include "xfs_unicode.h" = /* * xfs_get_dir_entry is used to get a reference to an inode given @@ -69,13 +70,16 @@ xfs_dir_lookup_int( uint lock_mode, bhv_vname_t *dentry, xfs_ino_t *inum, - xfs_inode_t **ipp) + xfs_inode_t **ipp, + char **actual_name, + int *actual_namelen) { int error; = xfs_itrace_entry(dp); = - error =3D xfs_dir_lookup(NULL, dp, VNAME(dentry), VNAMELEN(dentry), in= um); + error =3D xfs_dir_lookup(NULL, dp, VNAME(dentry), VNAMELEN(dentry), in= um, + actual_name, actual_namelen); if (!error) { /* * Unlock the directory. We do this because we can't @@ -102,6 +106,8 @@ xfs_dir_lookup_int( xfs_ilock(dp, lock_mode); error =3D XFS_ERROR(ENOENT); } + if (error && actual_name) + xfs_free_unicode_nls_name(*actual_name); } return error; } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_utils.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_utils.h 2008-01-21 14:42:51.000000000 +1100 +++ b/fs/xfs/xfs_utils.h 2007-10-26 15:35:54.052564595 +1000 @@ -23,7 +23,7 @@ = extern int xfs_get_dir_entry (bhv_vname_t *, xfs_inode_t **); extern int xfs_dir_lookup_int (xfs_inode_t *, uint, bhv_vname_t *, xfs_= ino_t *, - xfs_inode_t **); + xfs_inode_t **, char **, int *); extern int xfs_truncate_file (xfs_mount_t *, xfs_inode_t *); extern int xfs_dir_ialloc (xfs_trans_t **, xfs_inode_t *, mode_t, xfs_n= link_t, xfs_dev_t, cred_t *, prid_t, int, =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_vfsops.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_vfsops.c 2008-01-21 14:42:51.000000000 +1100 +++ b/fs/xfs/xfs_vfsops.c 2008-01-11 14:47:36.214448806 +1100 @@ -56,7 +56,7 @@ #include "xfs_fsops.h" #include "xfs_vnodeops.h" #include "xfs_vfsops.h" - +#include "xfs_unicode.h" = int xfs_init(void) @@ -81,6 +81,7 @@ xfs_init(void) xfs_acl_zone_init(xfs_acl_zone, "xfs_acl"); xfs_mru_cache_init(); xfs_filestream_init(); + xfs_unicode_init(); = /* * The size of the zone allocated buf log item is the maximum @@ -158,6 +159,7 @@ xfs_cleanup(void) xfs_cleanup_procfs(); xfs_sysctl_unregister(); xfs_refcache_destroy(); + xfs_unicode_uninit(); xfs_filestream_uninit(); xfs_mru_cache_uninit(); xfs_acl_zone_destroy(xfs_acl_zone); @@ -247,7 +249,6 @@ xfs_start_flags( mp->m_logname =3D kmem_alloc(strlen(ap->logname) + 1, KM_SLEEP); strcpy(mp->m_logname, ap->logname); } - if (ap->flags & XFSMNT_WSYNC) mp->m_flags |=3D XFS_MOUNT_WSYNC; #if XFS_BIG_INUMS @@ -404,6 +405,39 @@ xfs_finish_flags( mp->m_qflags |=3D XFS_OQUOTA_ENFD; } = + if (xfs_sb_version_hasunicode(&mp->m_sb)) { + if (ap->flags2 & XFSMNT2_CILOOKUP) + mp->m_flags |=3D XFS_MOUNT_CI_LOOKUP; + if (ap->flags2 & XFSMNT2_CIATTR) + mp->m_flags |=3D XFS_MOUNT_CI_ATTR; + + mp->m_nls =3D ap->nls[0] ? load_nls(ap->nls) : load_nls_default(); + if (!mp->m_nls) { + cmn_err(CE_WARN, + "XFS: unable to load nls mapping \"%s\"\n", ap->nls); + return XFS_ERROR(EINVAL); + } + if (strcmp(mp->m_nls->charset, XFS_NLS_UTF8) =3D=3D 0) { + /* special case utf8 - no translation required */ + unload_nls(mp->m_nls); + mp->m_nls =3D NULL; + } + } else { + /* + * Check for mount options which require a Unicode FS + */ + if (ap->flags2 & (XFSMNT2_CILOOKUP | XFSMNT2_CIATTR)) { + cmn_err(CE_WARN, + "XFS: can't do case-insensitive mount on non-utf8 filesystem"); + return XFS_ERROR(EINVAL); + + } + if (ap->nls[0]) { + cmn_err(CE_WARN, + "XFS: can't use nls mount option on non-utf8 filesystem"); + return XFS_ERROR(EINVAL); + } + } return 0; } = @@ -641,6 +675,8 @@ out: xfs_unmountfs(mp, credp); xfs_qmops_put(mp); xfs_dmops_put(mp); + if (mp->m_nls) + unload_nls(mp->m_nls); kmem_free(mp, sizeof(xfs_mount_t)); } = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_vnodeops.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_vnodeops.c 2008-01-21 14:42:51.000000000 +1100 +++ b/fs/xfs/xfs_vnodeops.c 2008-01-21 14:27:33.000000000 +1100 @@ -1772,7 +1772,9 @@ int xfs_lookup( xfs_inode_t *dp, bhv_vname_t *dentry, - bhv_vnode_t **vpp) + bhv_vnode_t **vpp, + char **actual_name, + int *actual_namelen) { xfs_inode_t *ip; xfs_ino_t e_inum; @@ -1785,7 +1787,8 @@ xfs_lookup( return XFS_ERROR(EIO); = lock_mode =3D xfs_ilock_map_shared(dp); - error =3D xfs_dir_lookup_int(dp, lock_mode, dentry, &e_inum, &ip); + error =3D xfs_dir_lookup_int(dp, lock_mode, dentry, &e_inum, &ip, + actual_name, actual_namelen); if (!error) { *vpp =3D XFS_ITOV(ip); xfs_itrace_ref(ip); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D fs/xfs/xfs_vnodeops.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- a/fs/xfs/xfs_vnodeops.h 2008-01-21 14:42:51.000000000 +1100 +++ b/fs/xfs/xfs_vnodeops.h 2008-01-21 14:27:33.000000000 +1100 @@ -24,7 +24,7 @@ int xfs_fsync(struct xfs_inode *ip, int = int xfs_release(struct xfs_inode *ip); int xfs_inactive(struct xfs_inode *ip); int xfs_lookup(struct xfs_inode *dp, bhv_vname_t *dentry, - bhv_vnode_t **vpp); + bhv_vnode_t **vpp, char **actual_name, int *actual_namelen); int xfs_create(struct xfs_inode *dp, bhv_vname_t *dentry, mode_t mode, xfs_dev_t rdev, bhv_vnode_t **vpp, struct cred *credp); int xfs_remove(struct xfs_inode *dp, bhv_vname_t *dentry); ------------OopNAZbFULX3uI7ekf9jl6-- From owner-xfs@oss.sgi.com Sun Jan 20 20:04:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 20:04:16 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0L446om003528 for ; Sun, 20 Jan 2008 20:04:10 -0800 X-ASG-Debug-ID: 1200888265-6b9d00540000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from pentafluge.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 15EF34E807C for ; Sun, 20 Jan 2008 20:04:25 -0800 (PST) Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by cuda.sgi.com with ESMTP id QtXFWwQljCRVnfum for ; Sun, 20 Jan 2008 20:04:25 -0800 (PST) Received: from hch by pentafluge.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1JGntX-0006gD-7I; Mon, 21 Jan 2008 04:04:23 +0000 Date: Mon, 21 Jan 2008 04:04:23 +0000 From: Christoph Hellwig To: "Josef 'Jeff' Sipek" Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/1] XFS: Replace custom AIL linked-list code with struct list_head Subject: Re: [PATCH 1/1] XFS: Replace custom AIL linked-list code with struct list_head Message-ID: <20080121040422.GA25541@infradead.org> References: <1200875757-26598-1-git-send-email-jeffpc@josefsipek.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1200875757-26598-1-git-send-email-jeffpc@josefsipek.net> User-Agent: Mutt/1.5.17 (2007-11-01) X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: pentafluge.infradead.org[213.146.154.40] X-Barracuda-Start-Time: 1200888266 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40041 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14219 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Sun, Jan 20, 2008 at 07:35:57PM -0500, Josef 'Jeff' Sipek wrote: > Signed-off-by: Josef 'Jeff' Sipek > --- > > I tested it with xfsqa, and things work as well as they do without it. I like this a lot, but I think Dave has plans to replace the linked list with a more efficient data structure soon, so it might not actually be worth applying. From owner-xfs@oss.sgi.com Sun Jan 20 20:07:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 20:07:37 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_55 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0L47WiP004044 for ; Sun, 20 Jan 2008 20:07:35 -0800 X-ASG-Debug-ID: 1200888471-2f0201c80000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from filer.fsl.cs.sunysb.edu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4D064CAAFCC for ; Sun, 20 Jan 2008 20:07:51 -0800 (PST) Received: from filer.fsl.cs.sunysb.edu (filer.fsl.cs.sunysb.edu [130.245.126.2]) by cuda.sgi.com with ESMTP id MIwv4GWlhLD0b6A3 for ; Sun, 20 Jan 2008 20:07:51 -0800 (PST) Received: from josefsipek.net (baal.fsl.cs.sunysb.edu [130.245.126.78]) by filer.fsl.cs.sunysb.edu (8.12.11.20060308/8.13.1) with ESMTP id m0L47cJK001053; Sun, 20 Jan 2008 23:07:38 -0500 Received: by josefsipek.net (Postfix, from userid 1000) id 9C7091C00D98; Sun, 20 Jan 2008 23:07:40 -0500 (EST) Date: Sun, 20 Jan 2008 23:07:40 -0500 From: "Josef 'Jeff' Sipek" To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/1] XFS: Replace custom AIL linked-list code with struct list_head Subject: Re: [PATCH 1/1] XFS: Replace custom AIL linked-list code with struct list_head Message-ID: <20080121040740.GA14938@josefsipek.net> References: <1200875757-26598-1-git-send-email-jeffpc@josefsipek.net> <20080121040422.GA25541@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080121040422.GA25541@infradead.org> User-Agent: Mutt/1.5.16 (2007-06-11) X-Barracuda-Connect: filer.fsl.cs.sunysb.edu[130.245.126.2] X-Barracuda-Start-Time: 1200888472 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40041 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14220 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jeffpc@josefsipek.net Precedence: bulk X-list: xfs On Mon, Jan 21, 2008 at 04:04:23AM +0000, Christoph Hellwig wrote: > On Sun, Jan 20, 2008 at 07:35:57PM -0500, Josef 'Jeff' Sipek wrote: > > Signed-off-by: Josef 'Jeff' Sipek > > --- > > > > I tested it with xfsqa, and things work as well as they do without it. > > I like this a lot, but I think Dave has plans to replace the linked list > with a more efficient data structure soon, so it might not actually be > worth applying. I've spoken with him about this, and he wants to have a tree where the leaves have linked lists (if I understood correctly). So this just makes it easier/cleaner for him. Josef 'Jeff' Sipek. -- Hegh QaQ law' quvHa'ghach QaQ puS From owner-xfs@oss.sgi.com Sun Jan 20 20:12:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 20:12:58 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L4CpK4004631 for ; Sun, 20 Jan 2008 20:12:54 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA22870; Mon, 21 Jan 2008 15:13:01 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0L4D0LF32440745; Mon, 21 Jan 2008 15:13:01 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0L4Cwwd32457968; Mon, 21 Jan 2008 15:12:58 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Mon, 21 Jan 2008 15:12:58 +1100 From: David Chinner To: Christoph Hellwig Cc: "Josef 'Jeff' Sipek" , xfs@oss.sgi.com Subject: Re: [PATCH 1/1] XFS: Replace custom AIL linked-list code with struct list_head Message-ID: <20080121041258.GZ155259@sgi.com> References: <1200875757-26598-1-git-send-email-jeffpc@josefsipek.net> <20080121040422.GA25541@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080121040422.GA25541@infradead.org> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14221 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Mon, Jan 21, 2008 at 04:04:23AM +0000, Christoph Hellwig wrote: > On Sun, Jan 20, 2008 at 07:35:57PM -0500, Josef 'Jeff' Sipek wrote: > > Signed-off-by: Josef 'Jeff' Sipek > > --- > > > > I tested it with xfsqa, and things work as well as they do without it. > > I like this a lot, but I think Dave has plans to replace the linked list > with a more efficient data structure soon, so it might not actually be > worth applying. Doesn't really make any difference to me - i've got to rebase the patch on the xfsaild thread commit anyway.... Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Sun Jan 20 20:16:40 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 20:16:43 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L4GanS005344 for ; Sun, 20 Jan 2008 20:16:39 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA22933; Mon, 21 Jan 2008 15:16:51 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0L4GoLF32455917; Mon, 21 Jan 2008 15:16:51 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0L4Gn7K32424034; Mon, 21 Jan 2008 15:16:49 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Mon, 21 Jan 2008 15:16:49 +1100 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [patch] reduce log I/O latency V2 Message-ID: <20080121041649.GA155259@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14222 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Reduce log I/O latency To ensure that log I/O is issued as the highest priority I/O, set the I/O priority of the log I/O to the highest possible. This will ensure that log I/O is not held up behind bulk data or other metadata I/O as delaying log I/O can pause the entire transaction subsystem. Introduce a new buffer flag to allow us to tag the log buffers so we can discriminate when issuing the I/O. Version 2: - don't use realtime priority class Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_buf.c | 3 +++ fs/xfs/linux-2.6/xfs_buf.h | 5 ++++- fs/xfs/xfs_log.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_buf.c 2007-12-19 01:39:42.286538135 +1100 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c 2007-12-19 11:56:47.977477993 +1100 @@ -1198,6 +1198,9 @@ next_chunk: submit_io: if (likely(bio->bi_size)) { + /* log I/O should not be delayed by anything except realtime. */ + if (bp->b_flags & XBF_LOG_BUFFER) + bio_set_prio(bio, IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 0)); submit_bio(rw, bio); if (size) goto next_chunk; Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_buf.h 2007-12-19 01:11:16.871181483 +1100 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.h 2007-12-19 11:55:09.642183801 +1100 @@ -53,7 +53,8 @@ typedef enum { XBF_DELWRI = (1 << 6), /* buffer has dirty pages */ XBF_STALE = (1 << 7), /* buffer has been staled, do not find it */ XBF_FS_MANAGED = (1 << 8), /* filesystem controls freeing memory */ - XBF_ORDERED = (1 << 11), /* use ordered writes */ + XBF_LOG_BUFFER = (1 << 9), /* Buffer issued by the log */ + XBF_ORDERED = (1 << 11), /* use ordered writes */ XBF_READ_AHEAD = (1 << 12), /* asynchronous read-ahead */ /* flags used only as arguments to access routines */ @@ -339,6 +340,8 @@ extern void xfs_buf_trace(xfs_buf_t *, c #define XFS_BUF_TARGET(bp) ((bp)->b_target) #define XFS_BUFTARG_NAME(target) xfs_buf_target_name(target) +#define XFS_BUF_SET_LOGBUF(bp) ((bp)->b_flags |= XBF_LOG_BUFFER) + static inline int xfs_bawrite(void *mp, xfs_buf_t *bp) { bp->b_fspriv3 = mp; Index: 2.6.x-xfs-new/fs/xfs/xfs_log.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_log.c 2007-12-19 01:11:16.871181483 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_log.c 2007-12-19 11:55:09.698176566 +1100 @@ -1443,6 +1443,8 @@ xlog_sync(xlog_t *log, XFS_BUF_ZEROFLAGS(bp); XFS_BUF_BUSY(bp); XFS_BUF_ASYNC(bp); + XFS_BUF_SET_LOGBUF(bp); + /* * Do an ordered write for the log block. * Its unnecessary to flush the first split block in the log wrap case. From owner-xfs@oss.sgi.com Sun Jan 20 20:18:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 20:18:20 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L4ICLj005611 for ; Sun, 20 Jan 2008 20:18:14 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA23067; Mon, 21 Jan 2008 15:18:28 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0L4IRLF32454040; Mon, 21 Jan 2008 15:18:27 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0L4IQ1N32338674; Mon, 21 Jan 2008 15:18:26 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Mon, 21 Jan 2008 15:18:26 +1100 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [patch] Use BIO_META tags for metadata rather than BIO_SYNC Message-ID: <20080121041826.GB155259@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14223 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Improve metadata I/O merging in the elevator Change all async metadata buffers to use [READ|WRITE]_META I/O types so that the I/O doesn't get issued immediately. This allows merging of adjacent metadata requests but still prioritises them over bulk data. This shows a 10-15% improvement in sequential create speed of small files. Don't include the log buffers in this classification - leave them as sync types so they are issued immediately. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_buf.c | 6 +++++- include/linux/fs.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_buf.c 2007-12-19 11:56:47.977477993 +1100 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c 2007-12-19 11:56:52.200932303 +1100 @@ -1136,10 +1136,14 @@ _xfs_buf_ioapply( if (bp->b_flags & XBF_ORDERED) { ASSERT(!(bp->b_flags & XBF_READ)); rw = WRITE_BARRIER; - } else if (bp->b_flags & _XBF_RUN_QUEUES) { + } else if (bp->b_flags & XBF_LOG_BUFFER) { ASSERT(!(bp->b_flags & XBF_READ_AHEAD)); bp->b_flags &= ~_XBF_RUN_QUEUES; rw = (bp->b_flags & XBF_WRITE) ? WRITE_SYNC : READ_SYNC; + } else if (bp->b_flags & _XBF_RUN_QUEUES) { + ASSERT(!(bp->b_flags & XBF_READ_AHEAD)); + bp->b_flags &= ~_XBF_RUN_QUEUES; + rw = (bp->b_flags & XBF_WRITE) ? WRITE_META : READ_META; } else { rw = (bp->b_flags & XBF_WRITE) ? WRITE : (bp->b_flags & XBF_READ_AHEAD) ? READA : READ; Index: 2.6.x-xfs-new/include/linux/fs.h =================================================================== --- 2.6.x-xfs-new.orig/include/linux/fs.h 2007-12-19 01:11:16.495229881 +1100 +++ 2.6.x-xfs-new/include/linux/fs.h 2007-12-19 11:56:52.352912667 +1100 @@ -83,6 +83,7 @@ extern int dir_notify_enable; #define READ_SYNC (READ | (1 << BIO_RW_SYNC)) #define READ_META (READ | (1 << BIO_RW_META)) #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) +#define WRITE_META (WRITE | (1 << BIO_RW_META)) #define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) #define SEL_IN 1 From owner-xfs@oss.sgi.com Sun Jan 20 20:38:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 20:38:45 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L4cYer011387 for ; Sun, 20 Jan 2008 20:38:38 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA23490; Mon, 21 Jan 2008 15:38:49 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0L4cmLF32437602; Mon, 21 Jan 2008 15:38:49 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0L4cl6a32461385; Mon, 21 Jan 2008 15:38:47 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Mon, 21 Jan 2008 15:38:47 +1100 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [patch] factor xfs_itobp V2 Message-ID: <20080121043847.GC155259@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14224 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Factor xfs_itobp() and xfs_inotobp(). The only difference between the functions is one passes an inode for the lookup, the other passes an inode number. However, they don't do the same validity checking or set all the same state on the buffer that is returned yet they should. Factor the functions into a common implementation. Version 2: - kill xfs_ino_to_imap and move checking inside xfs_imap Signed-off-by: Dave Chinner --- fs/xfs/xfs_inode.c | 261 +++++++++++++++++++++-------------------------------- 1 file changed, 106 insertions(+), 155 deletions(-) Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.c 2008-01-18 19:13:07.087183981 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.c 2008-01-21 15:35:39.980364728 +1100 @@ -126,6 +126,85 @@ xfs_inobp_check( #endif /* + * Find the buffer associated with the given inode map + * We do basic validation checks on the buffer once it has been + * retrieved from disk. + */ +STATIC int +xfs_imap_to_bp( + xfs_mount_t *mp, + xfs_trans_t *tp, + xfs_imap_t *imap, + xfs_buf_t **bpp, + uint buf_flags, + uint imap_flags) +{ + int error; + int i; + int ni; + xfs_buf_t *bp; + + error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, imap->im_blkno, + (int)imap->im_len, XFS_BUF_LOCK, &bp); + if (error) { + cmn_err(CE_WARN, "xfs_imap_to_bp: xfs_trans_read_buf()returned " + "an error %d on %s. Returning error.", + error, mp->m_fsname); + return error; + } + + /* + * Validate the magic number and version of every inode in the buffer + * (if DEBUG kernel) or the first inode in the buffer, otherwise. + */ +#ifdef DEBUG + ni = BBTOB(imap->im_len) >> mp->m_sb.sb_inodelog; +#else /* usual case */ + ni = 1; +#endif + + for (i = 0; i < ni; i++) { + int di_ok; + xfs_dinode_t *dip; + + dip = (xfs_dinode_t *)xfs_buf_offset(bp, + (i << mp->m_sb.sb_inodelog)); + di_ok = be16_to_cpu(dip->di_core.di_magic) == XFS_DINODE_MAGIC && + XFS_DINODE_GOOD_VERSION(dip->di_core.di_version); + if (unlikely(XFS_TEST_ERROR(!di_ok, mp, + XFS_ERRTAG_ITOBP_INOTOBP, + XFS_RANDOM_ITOBP_INOTOBP))) { + if (imap_flags & XFS_IMAP_BULKSTAT) { + xfs_trans_brelse(tp, bp); + return XFS_ERROR(EINVAL); + } + XFS_CORRUPTION_ERROR("xfs_imap_to_bp", + XFS_ERRLEVEL_HIGH, mp, dip); +#ifdef DEBUG + cmn_err(CE_PANIC, + "Device %s - bad inode magic/vsn " + "daddr %lld #%d (magic=%x)", + XFS_BUFTARG_NAME(mp->m_ddev_targp), + (unsigned long long)imap->im_blkno, i, + be16_to_cpu(dip->di_core.di_magic)); +#endif + xfs_trans_brelse(tp, bp); + return XFS_ERROR(EFSCORRUPTED); + } + } + + xfs_inobp_check(mp, bp); + + /* + * Mark the buffer as an inode buffer now that it looks good + */ + XFS_BUF_SET_VTYPE(bp, B_FS_INO); + + *bpp = bp; + return 0; +} + +/* * This routine is called to map an inode number within a file * system to the buffer containing the on-disk version of the * inode. It returns a pointer to the buffer containing the @@ -147,72 +226,19 @@ xfs_inotobp( xfs_buf_t **bpp, int *offset) { - int di_ok; xfs_imap_t imap; xfs_buf_t *bp; int error; - xfs_dinode_t *dip; - /* - * Call the space management code to find the location of the - * inode on disk. - */ imap.im_blkno = 0; error = xfs_imap(mp, tp, ino, &imap, XFS_IMAP_LOOKUP); - if (error != 0) { - cmn_err(CE_WARN, - "xfs_inotobp: xfs_imap() returned an " - "error %d on %s. Returning error.", error, mp->m_fsname); + if (error) return error; - } - - /* - * If the inode number maps to a block outside the bounds of the - * file system then return NULL rather than calling read_buf - * and panicing when we get an error from the driver. - */ - if ((imap.im_blkno + imap.im_len) > - XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)) { - cmn_err(CE_WARN, - "xfs_inotobp: inode number (%llu + %d) maps to a block outside the bounds " - "of the file system %s. Returning EINVAL.", - (unsigned long long)imap.im_blkno, - imap.im_len, mp->m_fsname); - return XFS_ERROR(EINVAL); - } - - /* - * Read in the buffer. If tp is NULL, xfs_trans_read_buf() will - * default to just a read_buf() call. - */ - error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, imap.im_blkno, - (int)imap.im_len, XFS_BUF_LOCK, &bp); - if (error) { - cmn_err(CE_WARN, - "xfs_inotobp: xfs_trans_read_buf() returned an " - "error %d on %s. Returning error.", error, mp->m_fsname); + error = xfs_imap_to_bp(mp, tp, &imap, &bp, XFS_BUF_LOCK, 0); + if (error) return error; - } - dip = (xfs_dinode_t *)xfs_buf_offset(bp, 0); - di_ok = - be16_to_cpu(dip->di_core.di_magic) == XFS_DINODE_MAGIC && - XFS_DINODE_GOOD_VERSION(dip->di_core.di_version); - if (unlikely(XFS_TEST_ERROR(!di_ok, mp, XFS_ERRTAG_ITOBP_INOTOBP, - XFS_RANDOM_ITOBP_INOTOBP))) { - XFS_CORRUPTION_ERROR("xfs_inotobp", XFS_ERRLEVEL_LOW, mp, dip); - xfs_trans_brelse(tp, bp); - cmn_err(CE_WARN, - "xfs_inotobp: XFS_TEST_ERROR() returned an " - "error on %s. Returning EFSCORRUPTED.", mp->m_fsname); - return XFS_ERROR(EFSCORRUPTED); - } - xfs_inobp_check(mp, bp); - - /* - * Set *dipp to point to the on-disk inode in the buffer. - */ *dipp = (xfs_dinode_t *)xfs_buf_offset(bp, imap.im_boffset); *bpp = bp; *offset = imap.im_boffset; @@ -253,41 +279,15 @@ xfs_itobp( xfs_imap_t imap; xfs_buf_t *bp; int error; - int i; - int ni; if (ip->i_blkno == (xfs_daddr_t)0) { - /* - * Call the space management code to find the location of the - * inode on disk. - */ imap.im_blkno = bno; - if ((error = xfs_imap(mp, tp, ip->i_ino, &imap, - XFS_IMAP_LOOKUP | imap_flags))) + error = xfs_imap(mp, tp, ip->i_ino, &imap, + XFS_IMAP_LOOKUP | imap_flags); + if (error) return error; /* - * If the inode number maps to a block outside the bounds - * of the file system then return NULL rather than calling - * read_buf and panicing when we get an error from the - * driver. - */ - if ((imap.im_blkno + imap.im_len) > - XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)) { -#ifdef DEBUG - xfs_fs_cmn_err(CE_ALERT, mp, "xfs_itobp: " - "(imap.im_blkno (0x%llx) " - "+ imap.im_len (0x%llx)) > " - " XFS_FSB_TO_BB(mp, " - "mp->m_sb.sb_dblocks) (0x%llx)", - (unsigned long long) imap.im_blkno, - (unsigned long long) imap.im_len, - XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)); -#endif /* DEBUG */ - return XFS_ERROR(EINVAL); - } - - /* * Fill in the fields in the inode that will be used to * map the inode to its buffer from now on. */ @@ -305,76 +305,10 @@ xfs_itobp( } ASSERT(bno == 0 || bno == imap.im_blkno); - /* - * Read in the buffer. If tp is NULL, xfs_trans_read_buf() will - * default to just a read_buf() call. - */ - error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, imap.im_blkno, - (int)imap.im_len, XFS_BUF_LOCK, &bp); - if (error) { -#ifdef DEBUG - xfs_fs_cmn_err(CE_ALERT, mp, "xfs_itobp: " - "xfs_trans_read_buf() returned error %d, " - "imap.im_blkno 0x%llx, imap.im_len 0x%llx", - error, (unsigned long long) imap.im_blkno, - (unsigned long long) imap.im_len); -#endif /* DEBUG */ + error = xfs_imap_to_bp(mp, tp, &imap, &bp, XFS_BUF_LOCK, imap_flags); + if (error) return error; - } - - /* - * Validate the magic number and version of every inode in the buffer - * (if DEBUG kernel) or the first inode in the buffer, otherwise. - * No validation is done here in userspace (xfs_repair). - */ -#if !defined(__KERNEL__) - ni = 0; -#elif defined(DEBUG) - ni = BBTOB(imap.im_len) >> mp->m_sb.sb_inodelog; -#else /* usual case */ - ni = 1; -#endif - - for (i = 0; i < ni; i++) { - int di_ok; - xfs_dinode_t *dip; - dip = (xfs_dinode_t *)xfs_buf_offset(bp, - (i << mp->m_sb.sb_inodelog)); - di_ok = be16_to_cpu(dip->di_core.di_magic) == XFS_DINODE_MAGIC && - XFS_DINODE_GOOD_VERSION(dip->di_core.di_version); - if (unlikely(XFS_TEST_ERROR(!di_ok, mp, - XFS_ERRTAG_ITOBP_INOTOBP, - XFS_RANDOM_ITOBP_INOTOBP))) { - if (imap_flags & XFS_IMAP_BULKSTAT) { - xfs_trans_brelse(tp, bp); - return XFS_ERROR(EINVAL); - } -#ifdef DEBUG - cmn_err(CE_ALERT, - "Device %s - bad inode magic/vsn " - "daddr %lld #%d (magic=%x)", - XFS_BUFTARG_NAME(mp->m_ddev_targp), - (unsigned long long)imap.im_blkno, i, - be16_to_cpu(dip->di_core.di_magic)); -#endif - XFS_CORRUPTION_ERROR("xfs_itobp", XFS_ERRLEVEL_HIGH, - mp, dip); - xfs_trans_brelse(tp, bp); - return XFS_ERROR(EFSCORRUPTED); - } - } - - xfs_inobp_check(mp, bp); - - /* - * Mark the buffer as an inode buffer now that it looks good - */ - XFS_BUF_SET_VTYPE(bp, B_FS_INO); - - /* - * Set *dipp to point to the on-disk inode in the buffer. - */ *dipp = (xfs_dinode_t *)xfs_buf_offset(bp, imap.im_boffset); *bpp = bp; return 0; @@ -2678,14 +2612,31 @@ xfs_imap( fsbno = imap->im_blkno ? XFS_DADDR_TO_FSB(mp, imap->im_blkno) : NULLFSBLOCK; error = xfs_dilocate(mp, tp, ino, &fsbno, &len, &off, flags); - if (error != 0) { + if (error) return error; - } + imap->im_blkno = XFS_FSB_TO_DADDR(mp, fsbno); imap->im_len = XFS_FSB_TO_BB(mp, len); imap->im_agblkno = XFS_FSB_TO_AGBNO(mp, fsbno); imap->im_ioffset = (ushort)off; imap->im_boffset = (ushort)(off << mp->m_sb.sb_inodelog); + + /* + * If the inode number maps to a block outside the bounds + * of the file system then return NULL rather than calling + * read_buf and panicing when we get an error from the + * driver. + */ + if ((imap->im_blkno + imap->im_len) > + XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)) { + xfs_fs_cmn_err(CE_ALERT, mp, "xfs_imap: " + "(imap->im_blkno (0x%llx) + imap->im_len (0x%llx)) > " + " XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks) (0x%llx)", + (unsigned long long) imap->im_blkno, + (unsigned long long) imap->im_len, + XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)); + return EINVAL; + } return 0; } From owner-xfs@oss.sgi.com Sun Jan 20 20:59:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 20:59:44 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62, J_CHICKENPOX_63,J_CHICKENPOX_65 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L4xRK0013170 for ; Sun, 20 Jan 2008 20:59:31 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA23834; Mon, 21 Jan 2008 15:59:41 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0L4xeLF32408561; Mon, 21 Jan 2008 15:59:41 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0L4xd5732464755; Mon, 21 Jan 2008 15:59:39 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Mon, 21 Jan 2008 15:59:39 +1100 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [patch] Don't block pdflush when flushing inodes V2 Message-ID: <20080121045939.GD155259@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14225 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs When pdflush is writing back inodes, it can get stuck on inode cluster buffers that are currently under I/O. This occurs when we write data to multiple inodes in the same inode cluster at the same time. Effectively, delayed allocation marks the inode dirty during the data writeback. Hence if the inode cluster was flushed during the writeback of the first inode, the writeback of the second inode will block waiting for the inode cluster write to complete before writing it again for the newly dirtied inode. Basically, we want to avoid this from happening so we don't block pdflush and slow down all of writeback. Hence we introduce a non-blocking async inode flush flag that pdflush uses. If this flag is set, we use non-blocking operations (e.g. try locks) whereever we can to avoid blocking or extra I/O being issued. Version 2: - kill xfs_itobp_flags() and just add a parameter to xfs_itobp - remove superfluous buf_flags == 0 check. - remove unneed parenthesis from comparison - introduce xfs_iunpin_nowait() for triggering a log flush to unpin the inode but not to wait for it. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_super.c | 3 fs/xfs/linux-2.6/xfs_vnode.h | 5 - fs/xfs/xfs_inode.c | 135 ++++++++++++++++++++++++++----------------- fs/xfs/xfs_inode.h | 3 fs/xfs/xfs_log_recover.c | 3 fs/xfs/xfs_trans_buf.c | 3 fs/xfs/xfs_vnodeops.c | 55 +++-------------- 7 files changed, 103 insertions(+), 104 deletions(-) Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.c 2008-01-21 15:35:39.980364728 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.c 2008-01-21 15:44:22.397197239 +1100 @@ -145,11 +145,16 @@ xfs_imap_to_bp( xfs_buf_t *bp; error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, imap->im_blkno, - (int)imap->im_len, XFS_BUF_LOCK, &bp); + (int)imap->im_len, buf_flags, &bp); if (error) { - cmn_err(CE_WARN, "xfs_imap_to_bp: xfs_trans_read_buf()returned " + if (error != EAGAIN) { + cmn_err(CE_WARN, + "xfs_imap_to_bp: xfs_trans_read_buf()returned " "an error %d on %s. Returning error.", error, mp->m_fsname); + } else { + ASSERT(buf_flags & XFS_BUF_TRYLOCK); + } return error; } @@ -274,7 +279,8 @@ xfs_itobp( xfs_dinode_t **dipp, xfs_buf_t **bpp, xfs_daddr_t bno, - uint imap_flags) + uint imap_flags, + uint buf_flags) { xfs_imap_t imap; xfs_buf_t *bp; @@ -305,10 +311,17 @@ xfs_itobp( } ASSERT(bno == 0 || bno == imap.im_blkno); - error = xfs_imap_to_bp(mp, tp, &imap, &bp, XFS_BUF_LOCK, imap_flags); + error = xfs_imap_to_bp(mp, tp, &imap, &bp, buf_flags, imap_flags); if (error) return error; + if (!bp) { + ASSERT(buf_flags & XFS_BUF_TRYLOCK); + ASSERT(tp == NULL); + *bpp = NULL; + return EAGAIN; + } + *dipp = (xfs_dinode_t *)xfs_buf_offset(bp, imap.im_boffset); *bpp = bp; return 0; @@ -812,7 +825,7 @@ xfs_iread( * return NULL as well. Set i_blkno to 0 so that xfs_itobp() will * know that this is a new incore inode. */ - error = xfs_itobp(mp, tp, ip, &dip, &bp, bno, imap_flags); + error = xfs_itobp(mp, tp, ip, &dip, &bp, bno, imap_flags, XFS_BUF_LOCK); if (error) { kmem_zone_free(xfs_inode_zone, ip); return error; @@ -1901,7 +1914,7 @@ xfs_iunlink( * Here we put the head pointer into our next pointer, * and then we fall through to point the head at us. */ - error = xfs_itobp(mp, tp, ip, &dip, &ibp, 0, 0); + error = xfs_itobp(mp, tp, ip, &dip, &ibp, 0, 0, XFS_BUF_LOCK); if (error) return error; @@ -2009,7 +2022,7 @@ xfs_iunlink_remove( * of dealing with the buffer when there is no need to * change it. */ - error = xfs_itobp(mp, tp, ip, &dip, &ibp, 0, 0); + error = xfs_itobp(mp, tp, ip, &dip, &ibp, 0, 0, XFS_BUF_LOCK); if (error) { cmn_err(CE_WARN, "xfs_iunlink_remove: xfs_itobp() returned an error %d on %s. Returning error.", @@ -2071,7 +2084,7 @@ xfs_iunlink_remove( * Now last_ibp points to the buffer previous to us on * the unlinked list. Pull us from the list. */ - error = xfs_itobp(mp, tp, ip, &dip, &ibp, 0, 0); + error = xfs_itobp(mp, tp, ip, &dip, &ibp, 0, 0, XFS_BUF_LOCK); if (error) { cmn_err(CE_WARN, "xfs_iunlink_remove: xfs_itobp() returned an error %d on %s. Returning error.", @@ -2334,7 +2347,7 @@ xfs_ifree( xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); - error = xfs_itobp(ip->i_mount, tp, ip, &dip, &ibp, 0, 0); + error = xfs_itobp(ip->i_mount, tp, ip, &dip, &ibp, 0, 0, XFS_BUF_LOCK); if (error) return error; @@ -2777,38 +2790,41 @@ xfs_iunpin( } /* - * This is called to wait for the given inode to be unpinned. - * It will sleep until this happens. The caller must have the - * inode locked in at least shared mode so that the buffer cannot - * be subsequently pinned once someone is waiting for it to be - * unpinned. + * This is called to unpin an inode. It can be directed to wait or to return + * immediately without waiting for the inode to be unpinned. The caller must + * have the inode locked in at least shared mode so that the buffer cannot be + * subsequently pinned once someone is waiting for it to be unpinned. */ STATIC void -xfs_iunpin_wait( - xfs_inode_t *ip) +__xfs_iunpin_wait( + xfs_inode_t *ip, + int wait) { - xfs_inode_log_item_t *iip; - xfs_lsn_t lsn; + xfs_inode_log_item_t *iip = ip->i_itemp; ASSERT(ismrlocked(&ip->i_lock, MR_UPDATE | MR_ACCESS)); - - if (atomic_read(&ip->i_pincount) == 0) { + if (atomic_read(&ip->i_pincount) == 0) return; - } - iip = ip->i_itemp; - if (iip && iip->ili_last_lsn) { - lsn = iip->ili_last_lsn; - } else { - lsn = (xfs_lsn_t)0; - } + /* Give the log a push to start the unpinning I/O */ + xfs_log_force(ip->i_mount, (iip && iip->ili_last_lsn) ? + iip->ili_last_lsn : 0, XFS_LOG_FORCE); + if (wait) + wait_event(ip->i_ipin_wait, (atomic_read(&ip->i_pincount) == 0)); +} - /* - * Give the log a push so we don't wait here too long. - */ - xfs_log_force(ip->i_mount, lsn, XFS_LOG_FORCE); +static inline void +xfs_iunpin_wait( + xfs_inode_t *ip) +{ + __xfs_iunpin_wait(ip, 1); +} - wait_event(ip->i_ipin_wait, (atomic_read(&ip->i_pincount) == 0)); +static inline void +xfs_iunpin_nowait( + xfs_inode_t *ip) +{ + __xfs_iunpin_wait(ip, 0); } @@ -3003,6 +3019,7 @@ xfs_iflush( int bufwasdelwri; struct hlist_node *entry; enum { INT_DELWRI = (1 << 0), INT_ASYNC = (1 << 1) }; + int noblock = (flags == XFS_IFLUSH_ASYNC_NOBLOCK); XFS_STATS_INC(xs_iflush_count); @@ -3027,11 +3044,21 @@ xfs_iflush( } /* - * We can't flush the inode until it is unpinned, so - * wait for it. We know noone new can pin it, because - * we are holding the inode lock shared and you need - * to hold it exclusively to pin the inode. + * We can't flush the inode until it is unpinned, so wait for it if we + * are allowed to block. We know noone new can pin it, because we are + * holding the inode lock shared and you need to hold it exclusively to + * pin the inode. + * + * If we are not allowed to block, force the log out asynchronously so + * that when we come back the inode will be unpinned. If other inodes + * in the same cluster are dirty, they will probably write the inode + * out for us if they occur after the log force completes. */ + if (noblock && xfs_ipincount(ip)) { + xfs_iunpin_nowait(ip); + xfs_ifunlock(ip); + return EAGAIN; + } xfs_iunpin_wait(ip); /* @@ -3048,15 +3075,6 @@ xfs_iflush( } /* - * Get the buffer containing the on-disk inode. - */ - error = xfs_itobp(mp, NULL, ip, &dip, &bp, 0, 0); - if (error) { - xfs_ifunlock(ip); - return error; - } - - /* * Decide how buffer will be flushed out. This is done before * the call to xfs_iflush_int because this field is zeroed by it. */ @@ -3072,6 +3090,7 @@ xfs_iflush( case XFS_IFLUSH_DELWRI_ELSE_SYNC: flags = 0; break; + case XFS_IFLUSH_ASYNC_NOBLOCK: case XFS_IFLUSH_ASYNC: case XFS_IFLUSH_DELWRI_ELSE_ASYNC: flags = INT_ASYNC; @@ -3091,6 +3110,7 @@ xfs_iflush( case XFS_IFLUSH_DELWRI: flags = INT_DELWRI; break; + case XFS_IFLUSH_ASYNC_NOBLOCK: case XFS_IFLUSH_ASYNC: flags = INT_ASYNC; break; @@ -3105,6 +3125,16 @@ xfs_iflush( } /* + * Get the buffer containing the on-disk inode. + */ + error = xfs_itobp(mp, NULL, ip, &dip, &bp, 0, 0, + noblock ? XFS_BUF_TRYLOCK : XFS_BUF_LOCK); + if (error || !bp) { + xfs_ifunlock(ip); + return error; + } + + /* * First flush out the inode that xfs_iflush was called with. */ error = xfs_iflush_int(ip, bp); @@ -3113,6 +3143,13 @@ xfs_iflush( } /* + * If the buffer is pinned then push on the log now so we won't + * get stuck waiting in the write for too long. + */ + if (XFS_BUF_ISPINNED(bp)) + xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE); + + /* * inode clustering: * see if other inodes can be gathered into this write */ @@ -3181,14 +3218,6 @@ xfs_iflush( XFS_STATS_ADD(xs_icluster_flushinode, clcount); } - /* - * If the buffer is pinned then push on the log so we won't - * get stuck waiting in the write for too long. - */ - if (XFS_BUF_ISPINNED(bp)){ - xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE); - } - if (flags & INT_DELWRI) { xfs_bdwrite(mp, bp); } else if (flags & INT_ASYNC) { Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.h 2008-01-21 15:19:50.582375528 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.h 2008-01-21 15:44:33.275799218 +1100 @@ -461,6 +461,7 @@ xfs_iflags_test_and_clear(xfs_inode_t *i #define XFS_IFLUSH_SYNC 3 #define XFS_IFLUSH_ASYNC 4 #define XFS_IFLUSH_DELWRI 5 +#define XFS_IFLUSH_ASYNC_NOBLOCK 6 /* * Flags for xfs_itruncate_start(). @@ -515,7 +516,7 @@ int xfs_finish_reclaim_all(struct xfs_m */ int xfs_itobp(struct xfs_mount *, struct xfs_trans *, xfs_inode_t *, struct xfs_dinode **, struct xfs_buf **, - xfs_daddr_t, uint); + xfs_daddr_t, uint, uint); int xfs_iread(struct xfs_mount *, struct xfs_trans *, xfs_ino_t, xfs_inode_t **, xfs_daddr_t, uint); int xfs_iread_extents(struct xfs_trans *, xfs_inode_t *, int); Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_super.c 2008-01-21 15:19:50.582375528 +1100 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_super.c 2008-01-21 15:38:51.287765170 +1100 @@ -898,7 +898,8 @@ xfs_fs_write_inode( struct inode *inode, int sync) { - int error = 0, flags = FLUSH_INODE; + int error = 0; + int flags = 0; xfs_itrace_entry(XFS_I(inode)); if (sync) { Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_vnode.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_vnode.h 2008-01-21 15:19:50.582375528 +1100 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_vnode.h 2008-01-21 15:38:51.287765170 +1100 @@ -73,12 +73,9 @@ typedef enum bhv_vrwlock { #define IO_INVIS 0x00020 /* don't update inode timestamps */ /* - * Flags for vop_iflush call + * Flags for xfs_inode_flush */ #define FLUSH_SYNC 1 /* wait for flush to complete */ -#define FLUSH_INODE 2 /* flush the inode itself */ -#define FLUSH_LOG 4 /* force the last log entry for - * this inode out to disk */ /* * Flush/Invalidate options for vop_toss/flush/flushinval_pages. Index: 2.6.x-xfs-new/fs/xfs/xfs_vnodeops.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_vnodeops.c 2008-01-21 15:19:50.594373988 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_vnodeops.c 2008-01-21 15:38:51.299763628 +1100 @@ -3504,29 +3504,6 @@ xfs_inode_flush( ((iip == NULL) || !(iip->ili_format.ilf_fields & XFS_ILOG_ALL))) return 0; - if (flags & FLUSH_LOG) { - if (iip && iip->ili_last_lsn) { - xlog_t *log = mp->m_log; - xfs_lsn_t sync_lsn; - int log_flags = XFS_LOG_FORCE; - - spin_lock(&log->l_grant_lock); - sync_lsn = log->l_last_sync_lsn; - spin_unlock(&log->l_grant_lock); - - if ((XFS_LSN_CMP(iip->ili_last_lsn, sync_lsn) > 0)) { - if (flags & FLUSH_SYNC) - log_flags |= XFS_LOG_SYNC; - error = xfs_log_force(mp, iip->ili_last_lsn, log_flags); - if (error) - return error; - } - - if (ip->i_update_core == 0) - return 0; - } - } - /* * We make this non-blocking if the inode is contended, * return EAGAIN to indicate to the caller that they @@ -3534,30 +3511,22 @@ xfs_inode_flush( * blocking on inodes inside another operation right * now, they get caught later by xfs_sync. */ - if (flags & FLUSH_INODE) { - int flush_flags; - - if (flags & FLUSH_SYNC) { - xfs_ilock(ip, XFS_ILOCK_SHARED); - xfs_iflock(ip); - } else if (xfs_ilock_nowait(ip, XFS_ILOCK_SHARED)) { - if (xfs_ipincount(ip) || !xfs_iflock_nowait(ip)) { - xfs_iunlock(ip, XFS_ILOCK_SHARED); - return EAGAIN; - } - } else { + if (flags & FLUSH_SYNC) { + xfs_ilock(ip, XFS_ILOCK_SHARED); + xfs_iflock(ip); + } else if (xfs_ilock_nowait(ip, XFS_ILOCK_SHARED)) { + if (xfs_ipincount(ip) || !xfs_iflock_nowait(ip)) { + xfs_iunlock(ip, XFS_ILOCK_SHARED); return EAGAIN; } - - if (flags & FLUSH_SYNC) - flush_flags = XFS_IFLUSH_SYNC; - else - flush_flags = XFS_IFLUSH_ASYNC; - - error = xfs_iflush(ip, flush_flags); - xfs_iunlock(ip, XFS_ILOCK_SHARED); + } else { + return EAGAIN; } + error = xfs_iflush(ip, (flags & FLUSH_SYNC) ? XFS_IFLUSH_SYNC + : XFS_IFLUSH_ASYNC_NOBLOCK); + xfs_iunlock(ip, XFS_ILOCK_SHARED); + return error; } Index: 2.6.x-xfs-new/fs/xfs/xfs_trans_buf.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_trans_buf.c 2008-01-21 15:19:50.610371934 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_trans_buf.c 2008-01-21 15:38:51.299763628 +1100 @@ -304,7 +304,8 @@ xfs_trans_read_buf( if (tp == NULL) { bp = xfs_buf_read_flags(target, blkno, len, flags | BUF_BUSY); if (!bp) - return XFS_ERROR(ENOMEM); + return (flags & XFS_BUF_TRYLOCK) ? + EAGAIN : XFS_ERROR(ENOMEM); if ((bp != NULL) && (XFS_BUF_GETERROR(bp) != 0)) { xfs_ioerror_alert("xfs_trans_read_buf", mp, Index: 2.6.x-xfs-new/fs/xfs/xfs_log_recover.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_log_recover.c 2008-01-16 16:24:02.000000000 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_log_recover.c 2008-01-21 15:49:42.440069284 +1100 @@ -3214,7 +3214,8 @@ xlog_recover_process_iunlinks( * next inode in the bucket. */ error = xfs_itobp(mp, NULL, ip, &dip, - &ibp, 0, 0); + &ibp, 0, 0, + XFS_BUF_LOCK); ASSERT(error || (dip != NULL)); } From owner-xfs@oss.sgi.com Sun Jan 20 21:05:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 21:06:15 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L55qO4013858 for ; Sun, 20 Jan 2008 21:05:55 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA24050; Mon, 21 Jan 2008 16:06:05 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0L564LF31997814; Mon, 21 Jan 2008 16:06:05 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0L563pZ32481189; Mon, 21 Jan 2008 16:06:03 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Mon, 21 Jan 2008 16:06:03 +1100 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [patch] remove xfs_icluster Message-ID: <20080121050603.GE155259@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14226 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Remove the xfs_icluster structure and replace with a radix tree lookup. We don't need to keep a list of inodes in each cluster around anymore as we can look them up quickly when we need to. The only time we need to do this now is during inode writeback. Factor the inode cluster writeback code out of xfs_iflush and convert it to use radix_tree_gang_lookup() instead of walking a list of inodes built when we first read in the inodes. This remove 3 pointers from each xfs_inode structure and the xfs_icluster structure per inode cluster. Hence we reduce the cache footprint of the xfs_inodes by between 5-10% depending on cluster sparseness. To be truly efficient we need a radix_tree_gang_lookup_range() call to stop searching once we are past the end of the cluster instead of trying to find a full cluster's worth of inodes. Before (ia64): $ cat /sys/slab/xfs_inode/object_size 536 After: $ cat /sys/slab/xfs_inode/object_size 512 Version 2: - rebase on current patch series Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_ksyms.c | 1 fs/xfs/xfs_iget.c | 49 ------- fs/xfs/xfs_inode.c | 266 ++++++++++++++++++++++++------------------- fs/xfs/xfs_inode.h | 16 -- fs/xfs/xfs_vfsops.c | 5 fs/xfs/xfsidbg.c | 4 6 files changed, 154 insertions(+), 187 deletions(-) Index: 2.6.x-xfs-new/fs/xfs/xfs_iget.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_iget.c 2008-01-21 15:19:50.210423275 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_iget.c 2008-01-21 15:59:58.916853279 +1100 @@ -78,7 +78,6 @@ xfs_iget_core( xfs_inode_t *ip; xfs_inode_t *iq; int error; - xfs_icluster_t *icl, *new_icl = NULL; unsigned long first_index, mask; xfs_perag_t *pag; xfs_agino_t agino; @@ -229,11 +228,9 @@ finish_inode: } /* - * This is a bit messy - we preallocate everything we _might_ - * need before we pick up the ici lock. That way we don't have to - * juggle locks and go all the way back to the start. + * Preload the radix tree so we can insert safely under the + * write spinlock. */ - new_icl = kmem_zone_alloc(xfs_icluster_zone, KM_SLEEP); if (radix_tree_preload(GFP_KERNEL)) { delay(1); goto again; @@ -241,17 +238,6 @@ finish_inode: mask = ~(((XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)) - 1); first_index = agino & mask; write_lock(&pag->pag_ici_lock); - - /* - * Find the cluster if it exists - */ - icl = NULL; - if (radix_tree_gang_lookup(&pag->pag_ici_root, (void**)&iq, - first_index, 1)) { - if ((XFS_INO_TO_AGINO(mp, iq->i_ino) & mask) == first_index) - icl = iq->i_cluster; - } - /* * insert the new inode */ @@ -266,30 +252,13 @@ finish_inode: } /* - * These values _must_ be set before releasing ihlock! + * These values _must_ be set before releasing the radix tree lock! */ ip->i_udquot = ip->i_gdquot = NULL; xfs_iflags_set(ip, XFS_INEW); - ASSERT(ip->i_cluster == NULL); - - if (!icl) { - spin_lock_init(&new_icl->icl_lock); - INIT_HLIST_HEAD(&new_icl->icl_inodes); - icl = new_icl; - new_icl = NULL; - } else { - ASSERT(!hlist_empty(&icl->icl_inodes)); - } - spin_lock(&icl->icl_lock); - hlist_add_head(&ip->i_cnode, &icl->icl_inodes); - ip->i_cluster = icl; - spin_unlock(&icl->icl_lock); - write_unlock(&pag->pag_ici_lock); radix_tree_preload_end(); - if (new_icl) - kmem_zone_free(xfs_icluster_zone, new_icl); /* * Link ip to its mount and thread it on the mount's inode list. @@ -528,18 +497,6 @@ xfs_iextract( xfs_put_perag(mp, pag); /* - * Remove from cluster list - */ - mp = ip->i_mount; - spin_lock(&ip->i_cluster->icl_lock); - hlist_del(&ip->i_cnode); - spin_unlock(&ip->i_cluster->icl_lock); - - /* was last inode in cluster? */ - if (hlist_empty(&ip->i_cluster->icl_inodes)) - kmem_zone_free(xfs_icluster_zone, ip->i_cluster); - - /* * Remove from mount's inode list. */ XFS_MOUNT_ILOCK(mp); Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.c 2008-01-21 15:44:22.397197239 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.c 2008-01-21 15:59:58.920852765 +1100 @@ -55,7 +55,6 @@ kmem_zone_t *xfs_ifork_zone; kmem_zone_t *xfs_inode_zone; -kmem_zone_t *xfs_icluster_zone; /* * Used in xfs_itruncate(). This is the maximum number of extents @@ -2994,6 +2993,151 @@ xfs_iflush_fork( return 0; } +STATIC int +xfs_iflush_cluster( + xfs_inode_t *ip, + xfs_buf_t *bp) +{ + xfs_mount_t *mp = ip->i_mount; + xfs_perag_t *pag = xfs_get_perag(mp, ip->i_ino); + unsigned long first_index, mask; + int ilist_size; + xfs_inode_t *ilist; + xfs_inode_t *iq; + xfs_inode_log_item_t *iip; + int nr_found; + int clcount = 0; + int bufwasdelwri; + + ASSERT(pag->pagi_inodeok); + ASSERT(pag->pag_ici_init); + + ilist_size = XFS_INODE_CLUSTER_SIZE(mp) * sizeof(xfs_inode_t *); + ilist = kmem_alloc(ilist_size, KM_MAYFAIL); + if (!ilist) + return 0; + + mask = ~(((XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)) - 1); + first_index = XFS_INO_TO_AGINO(mp, ip->i_ino) & mask; + read_lock(&pag->pag_ici_lock); + /* really need a gang lookup range call here */ + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, (void**)&ilist, + first_index, + XFS_INODE_CLUSTER_SIZE(mp)); + if (nr_found == 0) + goto out_free; + + for (iq = &ilist[0]; iq < &ilist[nr_found]; iq++) { + if (iq == ip) + continue; + /* if the inode lies outside this cluster, we're done. */ + if ((XFS_INO_TO_AGINO(mp, iq->i_ino) & mask) != first_index) + break; + /* + * Do an un-protected check to see if the inode is dirty and + * is a candidate for flushing. These checks will be repeated + * later after the appropriate locks are acquired. + */ + iip = iq->i_itemp; + if ((iq->i_update_core == 0) && + ((iip == NULL) || + !(iip->ili_format.ilf_fields & XFS_ILOG_ALL)) && + xfs_ipincount(iq) == 0) { + continue; + } + + /* + * Try to get locks. If any are unavailable or it is pinned, + * then this inode cannot be flushed and is skipped. + */ + + if (!xfs_ilock_nowait(iq, XFS_ILOCK_SHARED)) + continue; + if (!xfs_iflock_nowait(iq)) { + xfs_iunlock(iq, XFS_ILOCK_SHARED); + continue; + } + if (xfs_ipincount(iq)) { + xfs_ifunlock(iq); + xfs_iunlock(iq, XFS_ILOCK_SHARED); + continue; + } + + /* + * arriving here means that this inode can be flushed. First + * re-check that it's dirty before flushing. + */ + iip = iq->i_itemp; + if ((iq->i_update_core != 0) || ((iip != NULL) && + (iip->ili_format.ilf_fields & XFS_ILOG_ALL))) { + int error; + error = xfs_iflush_int(iq, bp); + if (error) { + xfs_iunlock(iq, XFS_ILOCK_SHARED); + goto cluster_corrupt_out; + } + clcount++; + } else { + xfs_ifunlock(iq); + } + xfs_iunlock(iq, XFS_ILOCK_SHARED); + } + + if (clcount) { + XFS_STATS_INC(xs_icluster_flushcnt); + XFS_STATS_ADD(xs_icluster_flushinode, clcount); + } + +out_free: + read_unlock(&pag->pag_ici_lock); + kmem_free(ilist, ilist_size); + return 0; + + +cluster_corrupt_out: + /* + * Corruption detected in the clustering loop. Invalidate the + * inode buffer and shut down the filesystem. + */ + read_unlock(&pag->pag_ici_lock); + /* + * Clean up the buffer. If it was B_DELWRI, just release it -- + * brelse can handle it with no problems. If not, shut down the + * filesystem before releasing the buffer. + */ + bufwasdelwri = XFS_BUF_ISDELAYWRITE(bp); + if (bufwasdelwri) + xfs_buf_relse(bp); + + xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); + + if (!bufwasdelwri) { + /* + * Just like incore_relse: if we have b_iodone functions, + * mark the buffer as an error and call them. Otherwise + * mark it as stale and brelse. + */ + if (XFS_BUF_IODONE_FUNC(bp)) { + XFS_BUF_CLR_BDSTRAT_FUNC(bp); + XFS_BUF_UNDONE(bp); + XFS_BUF_STALE(bp); + XFS_BUF_SHUT(bp); + XFS_BUF_ERROR(bp,EIO); + xfs_biodone(bp); + } else { + XFS_BUF_STALE(bp); + xfs_buf_relse(bp); + } + } + + /* + * Unlocks the flush lock + */ + xfs_iflush_abort(iq); + kmem_free(ilist, ilist_size); + return XFS_ERROR(EFSCORRUPTED); +} + /* * xfs_iflush() will write a modified inode's changes out to the * inode's on disk home. The caller must have the inode lock held @@ -3013,13 +3157,8 @@ xfs_iflush( xfs_dinode_t *dip; xfs_mount_t *mp; int error; - /* REFERENCED */ - xfs_inode_t *iq; - int clcount; /* count of inodes clustered */ - int bufwasdelwri; - struct hlist_node *entry; - enum { INT_DELWRI = (1 << 0), INT_ASYNC = (1 << 1) }; int noblock = (flags == XFS_IFLUSH_ASYNC_NOBLOCK); + enum { INT_DELWRI = (1 << 0), INT_ASYNC = (1 << 1) }; XFS_STATS_INC(xs_iflush_count); @@ -3138,9 +3277,8 @@ xfs_iflush( * First flush out the inode that xfs_iflush was called with. */ error = xfs_iflush_int(ip, bp); - if (error) { + if (error) goto corrupt_out; - } /* * If the buffer is pinned then push on the log now so we won't @@ -3153,70 +3291,9 @@ xfs_iflush( * inode clustering: * see if other inodes can be gathered into this write */ - spin_lock(&ip->i_cluster->icl_lock); - ip->i_cluster->icl_buf = bp; - - clcount = 0; - hlist_for_each_entry(iq, entry, &ip->i_cluster->icl_inodes, i_cnode) { - if (iq == ip) - continue; - - /* - * Do an un-protected check to see if the inode is dirty and - * is a candidate for flushing. These checks will be repeated - * later after the appropriate locks are acquired. - */ - iip = iq->i_itemp; - if ((iq->i_update_core == 0) && - ((iip == NULL) || - !(iip->ili_format.ilf_fields & XFS_ILOG_ALL)) && - xfs_ipincount(iq) == 0) { - continue; - } - - /* - * Try to get locks. If any are unavailable, - * then this inode cannot be flushed and is skipped. - */ - - /* get inode locks (just i_lock) */ - if (xfs_ilock_nowait(iq, XFS_ILOCK_SHARED)) { - /* get inode flush lock */ - if (xfs_iflock_nowait(iq)) { - /* check if pinned */ - if (xfs_ipincount(iq) == 0) { - /* arriving here means that - * this inode can be flushed. - * first re-check that it's - * dirty - */ - iip = iq->i_itemp; - if ((iq->i_update_core != 0)|| - ((iip != NULL) && - (iip->ili_format.ilf_fields & XFS_ILOG_ALL))) { - clcount++; - error = xfs_iflush_int(iq, bp); - if (error) { - xfs_iunlock(iq, - XFS_ILOCK_SHARED); - goto cluster_corrupt_out; - } - } else { - xfs_ifunlock(iq); - } - } else { - xfs_ifunlock(iq); - } - } - xfs_iunlock(iq, XFS_ILOCK_SHARED); - } - } - spin_unlock(&ip->i_cluster->icl_lock); - - if (clcount) { - XFS_STATS_INC(xs_icluster_flushcnt); - XFS_STATS_ADD(xs_icluster_flushinode, clcount); - } + error = xfs_iflush_cluster(ip, bp); + if (error) + goto cluster_corrupt_out; if (flags & INT_DELWRI) { xfs_bdwrite(mp, bp); @@ -3230,52 +3307,11 @@ xfs_iflush( corrupt_out: xfs_buf_relse(bp); xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); - xfs_iflush_abort(ip); - /* - * Unlocks the flush lock - */ - return XFS_ERROR(EFSCORRUPTED); - cluster_corrupt_out: - /* Corruption detected in the clustering loop. Invalidate the - * inode buffer and shut down the filesystem. - */ - spin_unlock(&ip->i_cluster->icl_lock); - - /* - * Clean up the buffer. If it was B_DELWRI, just release it -- - * brelse can handle it with no problems. If not, shut down the - * filesystem before releasing the buffer. - */ - if ((bufwasdelwri= XFS_BUF_ISDELAYWRITE(bp))) { - xfs_buf_relse(bp); - } - - xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); - - if(!bufwasdelwri) { - /* - * Just like incore_relse: if we have b_iodone functions, - * mark the buffer as an error and call them. Otherwise - * mark it as stale and brelse. - */ - if (XFS_BUF_IODONE_FUNC(bp)) { - XFS_BUF_CLR_BDSTRAT_FUNC(bp); - XFS_BUF_UNDONE(bp); - XFS_BUF_STALE(bp); - XFS_BUF_SHUT(bp); - XFS_BUF_ERROR(bp,EIO); - xfs_biodone(bp); - } else { - XFS_BUF_STALE(bp); - xfs_buf_relse(bp); - } - } - - xfs_iflush_abort(iq); /* * Unlocks the flush lock */ + xfs_iflush_abort(ip); return XFS_ERROR(EFSCORRUPTED); } Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.h 2008-01-21 15:44:33.275799218 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.h 2008-01-21 15:59:58.924852251 +1100 @@ -133,19 +133,6 @@ typedef struct dm_attrs_s { } dm_attrs_t; /* - * This is the xfs inode cluster structure. This structure is used by - * xfs_iflush to find inodes that share a cluster and can be flushed to disk at - * the same time. - */ -typedef struct xfs_icluster { - struct hlist_head icl_inodes; /* list of inodes on cluster */ - xfs_daddr_t icl_blkno; /* starting block number of - * the cluster */ - struct xfs_buf *icl_buf; /* the inode buffer */ - spinlock_t icl_lock; /* inode list lock */ -} xfs_icluster_t; - -/* * This is the xfs in-core inode structure. * Most of the on-disk inode is embedded in the i_d field. * @@ -252,8 +239,6 @@ typedef struct xfs_inode { unsigned int i_delayed_blks; /* count of delay alloc blks */ xfs_icdinode_t i_d; /* most of ondisk inode */ - xfs_icluster_t *i_cluster; /* cluster list header */ - struct hlist_node i_cnode; /* cluster link node */ xfs_fsize_t i_size; /* in-memory size */ xfs_fsize_t i_new_size; /* size when write completes */ @@ -598,7 +583,6 @@ void xfs_inobp_check(struct xfs_mount * #define xfs_inobp_check(mp, bp) #endif /* DEBUG */ -extern struct kmem_zone *xfs_icluster_zone; extern struct kmem_zone *xfs_ifork_zone; extern struct kmem_zone *xfs_inode_zone; extern struct kmem_zone *xfs_ili_zone; Index: 2.6.x-xfs-new/fs/xfs/xfs_vfsops.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_vfsops.c 2008-01-21 15:19:50.210423275 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_vfsops.c 2008-01-21 15:59:58.928851738 +1100 @@ -113,9 +113,6 @@ xfs_init(void) xfs_ili_zone = kmem_zone_init_flags(sizeof(xfs_inode_log_item_t), "xfs_ili", KM_ZONE_SPREAD, NULL); - xfs_icluster_zone = - kmem_zone_init_flags(sizeof(xfs_icluster_t), "xfs_icluster", - KM_ZONE_SPREAD, NULL); /* * Allocate global trace buffers. @@ -153,7 +150,6 @@ xfs_cleanup(void) extern kmem_zone_t *xfs_inode_zone; extern kmem_zone_t *xfs_efd_zone; extern kmem_zone_t *xfs_efi_zone; - extern kmem_zone_t *xfs_icluster_zone; xfs_cleanup_procfs(); xfs_sysctl_unregister(); @@ -189,7 +185,6 @@ xfs_cleanup(void) kmem_zone_destroy(xfs_efi_zone); kmem_zone_destroy(xfs_ifork_zone); kmem_zone_destroy(xfs_ili_zone); - kmem_zone_destroy(xfs_icluster_zone); } /* Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-01-21 15:19:50.226421221 +1100 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_ksyms.c 2008-01-21 15:59:58.928851738 +1100 @@ -211,7 +211,6 @@ EXPORT_SYMBOL(xfs_bulkstat); EXPORT_SYMBOL(xfs_bunmapi); EXPORT_SYMBOL(xfs_bwrite); EXPORT_SYMBOL(xfs_change_file_space); -EXPORT_SYMBOL(xfs_icluster_zone); EXPORT_SYMBOL(xfs_dev_is_read_only); EXPORT_SYMBOL(xfs_dir_ialloc); EXPORT_SYMBOL(xfs_error_report); Index: 2.6.x-xfs-new/fs/xfs/xfsidbg.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfsidbg.c 2008-01-21 15:19:50.226421221 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfsidbg.c 2008-01-21 15:59:58.944849682 +1100 @@ -6465,10 +6465,6 @@ xfsidbg_xnode(xfs_inode_t *ip) qprintf(" dir trace 0x%p\n", ip->i_dir_trace); #endif kdb_printf("\n"); - kdb_printf("icluster 0x%p cnext 0x%p cprev 0x%p\n", - ip->i_cluster, - ip->i_cnode.next, - ip->i_cnode.pprev); xfs_xnode_fork("data", &ip->i_df); xfs_xnode_fork("attr", ip->i_afp); kdb_printf("\n"); From owner-xfs@oss.sgi.com Sun Jan 20 21:13:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 21:13:46 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L5DT3G014757 for ; Sun, 20 Jan 2008 21:13:34 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA24141; Mon, 21 Jan 2008 16:13:43 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0L5DgLF32458165; Mon, 21 Jan 2008 16:13:42 +1100 (AEDT) Received: (from xaiki@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0L5DfKI32404125; Mon, 21 Jan 2008 16:13:41 +1100 (AEDT) Date: Mon, 21 Jan 2008 16:13:41 +1100 From: Niv Sardi To: Eric Sandeen Cc: xfs-oss Subject: Re: small problem w/ new xfs defaults patch Message-ID: <20080121051341.GA31708862@melbourne.sgi.com> References: <4794159F.9070505@sandeen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4794159F.9070505@sandeen.net> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14227 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs * Eric Sandeen [2008-01-20 21:46:39 -0600]: > Index: xfsprogs-2.9.4/growfs/xfs_growfs.c > =================================================================== [...] > couple things... you lost a "\n" off the end of the data section there... That has been fixed, I guess it needs to be sent to oss (barry?) > Also, do you really want to drop reporting of unwritten extents? Even > if you're disallowing the selection on new mkfs's there may still be > different flavors of filesystems in existence, should it still be reported? I don't really care, whatever the oss/xfs-master people like best. Cheers -- Niv From owner-xfs@oss.sgi.com Sun Jan 20 21:16:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 21:16:49 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L5GYjP015238 for ; Sun, 20 Jan 2008 21:16:37 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA24290; Mon, 21 Jan 2008 16:16:49 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0L5GmLF32437488; Mon, 21 Jan 2008 16:16:49 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0L5Glcg32439652; Mon, 21 Jan 2008 16:16:47 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Mon, 21 Jan 2008 16:16:47 +1100 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [patch] Use xfs_inode_clean() in more places Message-ID: <20080121051647.GF155259@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14228 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Use xfs_inode_clean() in more places. Version 2: - remove eye-hurting STATIC_INLINE - make check less verbose Signed-off-by: Dave Chinner --- fs/xfs/xfs_inode.c | 27 +++++---------------------- fs/xfs/xfs_inode_item.h | 8 ++++++++ fs/xfs/xfs_vnodeops.c | 4 +--- 3 files changed, 14 insertions(+), 25 deletions(-) Index: 2.6.x-xfs-new/fs/xfs/xfs_inode.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode.c 2008-01-21 16:06:27.000000000 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode.c 2008-01-21 16:08:47.893673473 +1100 @@ -2118,13 +2118,6 @@ xfs_iunlink_remove( return 0; } -STATIC_INLINE int xfs_inode_clean(xfs_inode_t *ip) -{ - return (((ip->i_itemp == NULL) || - !(ip->i_itemp->ili_format.ilf_fields & XFS_ILOG_ALL)) && - (ip->i_update_core == 0)); -} - STATIC void xfs_ifree_cluster( xfs_inode_t *free_ip, @@ -3004,7 +2997,6 @@ xfs_iflush_cluster( int ilist_size; xfs_inode_t *ilist; xfs_inode_t *iq; - xfs_inode_log_item_t *iip; int nr_found; int clcount = 0; int bufwasdelwri; @@ -3038,13 +3030,8 @@ xfs_iflush_cluster( * is a candidate for flushing. These checks will be repeated * later after the appropriate locks are acquired. */ - iip = iq->i_itemp; - if ((iq->i_update_core == 0) && - ((iip == NULL) || - !(iip->ili_format.ilf_fields & XFS_ILOG_ALL)) && - xfs_ipincount(iq) == 0) { + if (xfs_inode_clean(iq) && xfs_ipincount(iq) == 0) continue; - } /* * Try to get locks. If any are unavailable or it is pinned, @@ -3067,10 +3054,8 @@ xfs_iflush_cluster( * arriving here means that this inode can be flushed. First * re-check that it's dirty before flushing. */ - iip = iq->i_itemp; - if ((iq->i_update_core != 0) || ((iip != NULL) && - (iip->ili_format.ilf_fields & XFS_ILOG_ALL))) { - int error; + if (!xfs_inode_clean(iq)) { + int error; error = xfs_iflush_int(iq, bp); if (error) { xfs_iunlock(iq, XFS_ILOCK_SHARED); @@ -3174,8 +3159,7 @@ xfs_iflush( * If the inode isn't dirty, then just release the inode * flush lock and do nothing. */ - if ((ip->i_update_core == 0) && - ((iip == NULL) || !(iip->ili_format.ilf_fields & XFS_ILOG_ALL))) { + if (xfs_inode_clean(ip)) { ASSERT((iip != NULL) ? !(iip->ili_item.li_flags & XFS_LI_IN_AIL) : 1); xfs_ifunlock(ip); @@ -3341,8 +3325,7 @@ xfs_iflush_int( * If the inode isn't dirty, then just release the inode * flush lock and do nothing. */ - if ((ip->i_update_core == 0) && - ((iip == NULL) || !(iip->ili_format.ilf_fields & XFS_ILOG_ALL))) { + if (xfs_inode_clean(ip)) { xfs_ifunlock(ip); return 0; } Index: 2.6.x-xfs-new/fs/xfs/xfs_vnodeops.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_vnodeops.c 2008-01-21 16:06:27.000000000 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_vnodeops.c 2008-01-21 16:08:47.897672964 +1100 @@ -3490,7 +3490,6 @@ xfs_inode_flush( int flags) { xfs_mount_t *mp = ip->i_mount; - xfs_inode_log_item_t *iip = ip->i_itemp; int error = 0; if (XFS_FORCED_SHUTDOWN(mp)) @@ -3500,8 +3499,7 @@ xfs_inode_flush( * Bypass inodes which have already been cleaned by * the inode flush clustering code inside xfs_iflush */ - if ((ip->i_update_core == 0) && - ((iip == NULL) || !(iip->ili_format.ilf_fields & XFS_ILOG_ALL))) + if (xfs_inode_clean(ip)) return 0; /* Index: 2.6.x-xfs-new/fs/xfs/xfs_inode_item.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_inode_item.h 2008-01-21 16:06:27.000000000 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_inode_item.h 2008-01-21 16:14:34.001674576 +1100 @@ -168,6 +168,14 @@ static inline int xfs_ilog_fext(int w) return (w == XFS_DATA_FORK ? XFS_ILOG_DEXT : XFS_ILOG_AEXT); } +static inline int xfs_inode_clean(xfs_inode_t *ip) +{ + return (!ip->i_itemp || + !(ip->i_itemp->ili_format.ilf_fields & XFS_ILOG_ALL)) && + !ip->i_update_core; +} + + #ifdef __KERNEL__ extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *); From owner-xfs@oss.sgi.com Sun Jan 20 21:23:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 21:23:24 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L5NHLP016266 for ; Sun, 20 Jan 2008 21:23:21 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA24524; Mon, 21 Jan 2008 16:23:32 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0L5NVLF32487689; Mon, 21 Jan 2008 16:23:32 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0L5NUvP32475941; Mon, 21 Jan 2008 16:23:30 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Mon, 21 Jan 2008 16:23:30 +1100 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [patch] Prevent AIL lock contention during transaction completion Message-ID: <20080121052330.GG155259@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14229 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs When hundreds of processors attempt to commit transactions at the same time, they can contend on the AIL lock when updating the tail LSN held in the in-core log structure. At the moment, the tail LSN is only needed when actually writing out an iclog, so it really does not need to be updated on every single transaction completion - only those that result in switching iclogs and flushing them to disk. The result is that we reduce the number oftimes we need to grab the AIL lock and the log grant lock by up to two orders of magnitude on large processor count machines. The problem has previously been hidden by AIL lock contention walking the AIL list, which has recently been solved. Signed-off-by: Dave Chinner --- fs/xfs/xfs_log.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) Index: 2.6.x-xfs-new/fs/xfs/xfs_log.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_log.c 2008-01-21 16:06:27.187549816 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_log.c 2008-01-21 16:16:51.804146394 +1100 @@ -2815,15 +2815,13 @@ xlog_state_put_ticket(xlog_t *log, * */ STATIC int -xlog_state_release_iclog(xlog_t *log, - xlog_in_core_t *iclog) +xlog_state_release_iclog( + xlog_t *log, + xlog_in_core_t *iclog) { int sync = 0; /* do we sync? */ - xlog_assign_tail_lsn(log->l_mp); - spin_lock(&log->l_icloglock); - if (iclog->ic_state & XLOG_STATE_IOERROR) { spin_unlock(&log->l_icloglock); return XFS_ERROR(EIO); @@ -2835,13 +2833,14 @@ xlog_state_release_iclog(xlog_t *log, if (--iclog->ic_refcnt == 0 && iclog->ic_state == XLOG_STATE_WANT_SYNC) { + /* update tail before writing to iclog */ + xlog_assign_tail_lsn(log->l_mp); sync++; iclog->ic_state = XLOG_STATE_SYNCING; iclog->ic_header.h_tail_lsn = cpu_to_be64(log->l_tail_lsn); xlog_verify_tail_lsn(log, iclog, log->l_tail_lsn); /* cycle incremented when incrementing curr_block */ } - spin_unlock(&log->l_icloglock); /* @@ -2851,11 +2850,9 @@ xlog_state_release_iclog(xlog_t *log, * this iclog has consistent data, so we ignore IOERROR * flags after this point. */ - if (sync) { + if (sync) return xlog_sync(log, iclog); - } return 0; - } /* xlog_state_release_iclog */ From owner-xfs@oss.sgi.com Sun Jan 20 21:29:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 21:29:16 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0L5T9hW016944 for ; Sun, 20 Jan 2008 21:29:12 -0800 X-ASG-Debug-ID: 1200893367-36b6004f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2973A53EB71 for ; Sun, 20 Jan 2008 21:29:28 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id 8kprRHVRjr8y8MgY for ; Sun, 20 Jan 2008 21:29:28 -0800 (PST) Received: from Liberator.local (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 0282D18D9228C; Sun, 20 Jan 2008 23:29:25 -0600 (CST) Message-ID: <47942DB5.6040708@sandeen.net> Date: Sun, 20 Jan 2008 23:29:25 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Niv Sardi CC: xfs-oss X-ASG-Orig-Subj: Re: small problem w/ new xfs defaults patch Subject: Re: small problem w/ new xfs defaults patch References: <4794159F.9070505@sandeen.net> <20080121051341.GA31708862@melbourne.sgi.com> In-Reply-To: <20080121051341.GA31708862@melbourne.sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1200893369 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40046 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14230 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 Niv Sardi wrote: > * Eric Sandeen [2008-01-20 21:46:39 -0600]: > >> Index: xfsprogs-2.9.4/growfs/xfs_growfs.c >> =================================================================== > [...] >> couple things... you lost a "\n" off the end of the data section there... > > That has been fixed, I guess it needs to be sent to oss (barry?) Ok, see that. Sorry... grabbed the original patch and didn't check cvs for updates. Thanks, -Eric >> Also, do you really want to drop reporting of unwritten extents? Even >> if you're disallowing the selection on new mkfs's there may still be >> different flavors of filesystems in existence, should it still be reported? > > I don't really care, whatever the oss/xfs-master people like best. > > Cheers From owner-xfs@oss.sgi.com Sun Jan 20 21:30:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 21:30:18 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L5U9ZW017213 for ; Sun, 20 Jan 2008 21:30:13 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA24790; Mon, 21 Jan 2008 16:30:23 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0L5UMLF32471221; Mon, 21 Jan 2008 16:30:23 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0L5ULsk32486506; Mon, 21 Jan 2008 16:30:21 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Mon, 21 Jan 2008 16:30:21 +1100 From: David Chinner To: xfs-dev Cc: xfs-oss Subject: [patch] Use atomics for iclog reference counting Message-ID: <20080121053021.GH155259@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14231 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Now that we update the log tail LSN less frequently on transaction completion, we pass the contention straight to the global block stat lock (l_iclog_lock) during transaction completion. We currently have to take this lock to decrement the iclog reference count. there is a reference count on each iclog, so we need to take þhe global lock for all refcount changes. When large numbers of processes are all doing small trnasctions, the iclog reference counts will be quite high, and the state change that absolutely requires the l_iclog_lock is the except rather than the norm. Change the reference counting on the iclogs to use atomic_inc/dec so that we can use atomic_dec_and_lock during transaction completion and avoid the need for grabbing the l_iclog_lock for every reference count decrement except the one that matters - the last. Signed-off-by: Dave Chinner --- fs/xfs/xfs_log.c | 36 +++++++++++++++++++++--------------- fs/xfs/xfs_log_priv.h | 2 +- fs/xfs/xfsidbg.c | 2 +- 3 files changed, 23 insertions(+), 17 deletions(-) Index: 2.6.x-xfs-new/fs/xfs/xfs_log.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_log.c 2008-01-21 16:16:51.804146394 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_log.c 2008-01-21 16:23:35.369691221 +1100 @@ -675,7 +675,7 @@ xfs_log_unmount_write(xfs_mount_t *mp) spin_lock(&log->l_icloglock); iclog = log->l_iclog; - iclog->ic_refcnt++; + atomic_inc(&iclog->ic_refcnt); spin_unlock(&log->l_icloglock); xlog_state_want_sync(log, iclog); (void) xlog_state_release_iclog(log, iclog); @@ -713,7 +713,7 @@ xfs_log_unmount_write(xfs_mount_t *mp) */ spin_lock(&log->l_icloglock); iclog = log->l_iclog; - iclog->ic_refcnt++; + atomic_inc(&iclog->ic_refcnt); spin_unlock(&log->l_icloglock); xlog_state_want_sync(log, iclog); @@ -1405,7 +1405,7 @@ xlog_sync(xlog_t *log, int v2 = XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb); XFS_STATS_INC(xs_log_writes); - ASSERT(iclog->ic_refcnt == 0); + ASSERT(atomic_read(&iclog->ic_refcnt) == 0); /* Add for LR header */ count_init = log->l_iclog_hsize + iclog->ic_offset; @@ -2311,7 +2311,7 @@ xlog_state_done_syncing( ASSERT(iclog->ic_state == XLOG_STATE_SYNCING || iclog->ic_state == XLOG_STATE_IOERROR); - ASSERT(iclog->ic_refcnt == 0); + ASSERT(atomic_read(&iclog->ic_refcnt) == 0); ASSERT(iclog->ic_bwritecnt == 1 || iclog->ic_bwritecnt == 2); @@ -2393,7 +2393,7 @@ restart: ASSERT(iclog->ic_state == XLOG_STATE_ACTIVE); head = &iclog->ic_header; - iclog->ic_refcnt++; /* prevents sync */ + atomic_inc(&iclog->ic_refcnt); /* prevents sync */ log_offset = iclog->ic_offset; /* On the 1st write to an iclog, figure out lsn. This works @@ -2425,12 +2425,12 @@ restart: xlog_state_switch_iclogs(log, iclog, iclog->ic_size); /* If I'm the only one writing to this iclog, sync it to disk */ - if (iclog->ic_refcnt == 1) { + if (atomic_read(&iclog->ic_refcnt) == 1) { spin_unlock(&log->l_icloglock); if ((error = xlog_state_release_iclog(log, iclog))) return error; } else { - iclog->ic_refcnt--; + atomic_dec(&iclog->ic_refcnt); spin_unlock(&log->l_icloglock); } goto restart; @@ -2821,18 +2821,23 @@ xlog_state_release_iclog( { int sync = 0; /* do we sync? */ - spin_lock(&log->l_icloglock); if (iclog->ic_state & XLOG_STATE_IOERROR) { spin_unlock(&log->l_icloglock); return XFS_ERROR(EIO); } - ASSERT(iclog->ic_refcnt > 0); + ASSERT(atomic_read(&iclog->ic_refcnt) > 0); + if (!atomic_dec_and_lock(&iclog->ic_refcnt, &log->l_icloglock)) + return 0; + + if (iclog->ic_state & XLOG_STATE_IOERROR) { + spin_unlock(&log->l_icloglock); + return XFS_ERROR(EIO); + } ASSERT(iclog->ic_state == XLOG_STATE_ACTIVE || iclog->ic_state == XLOG_STATE_WANT_SYNC); - if (--iclog->ic_refcnt == 0 && - iclog->ic_state == XLOG_STATE_WANT_SYNC) { + if (iclog->ic_state == XLOG_STATE_WANT_SYNC) { /* update tail before writing to iclog */ xlog_assign_tail_lsn(log->l_mp); sync++; @@ -2952,7 +2957,8 @@ xlog_state_sync_all(xlog_t *log, uint fl * previous iclog and go to sleep. */ if (iclog->ic_state == XLOG_STATE_DIRTY || - (iclog->ic_refcnt == 0 && iclog->ic_offset == 0)) { + (atomic_read(&iclog->ic_refcnt) == 0 + && iclog->ic_offset == 0)) { iclog = iclog->ic_prev; if (iclog->ic_state == XLOG_STATE_ACTIVE || iclog->ic_state == XLOG_STATE_DIRTY) @@ -2960,14 +2966,14 @@ xlog_state_sync_all(xlog_t *log, uint fl else goto maybe_sleep; } else { - if (iclog->ic_refcnt == 0) { + if (atomic_read(&iclog->ic_refcnt) == 0) { /* We are the only one with access to this * iclog. Flush it out now. There should * be a roundoff of zero to show that someone * has already taken care of the roundoff from * the previous sync. */ - iclog->ic_refcnt++; + atomic_inc(&iclog->ic_refcnt); lsn = be64_to_cpu(iclog->ic_header.h_lsn); xlog_state_switch_iclogs(log, iclog, 0); spin_unlock(&log->l_icloglock); @@ -3099,7 +3105,7 @@ try_again: already_slept = 1; goto try_again; } else { - iclog->ic_refcnt++; + atomic_inc(&iclog->ic_refcnt); xlog_state_switch_iclogs(log, iclog, 0); spin_unlock(&log->l_icloglock); if (xlog_state_release_iclog(log, iclog)) Index: 2.6.x-xfs-new/fs/xfs/xfs_log_priv.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_log_priv.h 2008-01-21 16:06:27.127557437 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_log_priv.h 2008-01-21 16:23:35.369691221 +1100 @@ -339,7 +339,7 @@ typedef struct xlog_iclog_fields { #endif int ic_size; int ic_offset; - int ic_refcnt; + atomic_t ic_refcnt; int ic_bwritecnt; ushort_t ic_state; char *ic_datap; /* pointer to iclog data */ Index: 2.6.x-xfs-new/fs/xfs/xfsidbg.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfsidbg.c 2008-01-21 16:06:27.127557437 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfsidbg.c 2008-01-21 16:23:35.385689220 +1100 @@ -5633,7 +5633,7 @@ xfsidbg_xiclog(xlog_in_core_t *iclog) #else NULL, #endif - iclog->ic_refcnt, iclog->ic_bwritecnt); + atomic_read(&iclog->ic_refcnt), iclog->ic_bwritecnt); if (iclog->ic_state & XLOG_STATE_ALL) printflags(iclog->ic_state, ic_flags, " state:"); else From owner-xfs@oss.sgi.com Sun Jan 20 21:36:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 21:36:16 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_35, J_CHICKENPOX_36,J_CHICKENPOX_37,J_CHICKENPOX_38,J_CHICKENPOX_39 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L5a5nc018018 for ; Sun, 20 Jan 2008 21:36:10 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA24875; Mon, 21 Jan 2008 16:36:24 +1100 Date: Mon, 21 Jan 2008 16:37:53 +1100 To: "xfs@oss.sgi.com" , xfs-dev Subject: [REVIEW] growfs support for CI From: "Barry Naujok" Organization: SGI Content-Type: multipart/mixed; boundary=----------cnxN6PYfs48WGnrhyS2w9D MIME-Version: 1.0 Message-ID: User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14232 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs ------------cnxN6PYfs48WGnrhyS2w9D Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 Content-Transfer-Encoding: 7bit Missed in the first set of patches was xfs_growfs/xfs_info support for the CI stuff. Attached is additional patches for kernel and user-space. Barry. ------------cnxN6PYfs48WGnrhyS2w9D Content-Disposition: attachment; filename=ci_growfs_kernel.patch Content-Type: text/x-patch; name=ci_growfs_kernel.patch Content-Transfer-Encoding: Base64 Cj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpmcy94ZnMveGZzX2Zz LmgKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CgotLS0gYS9mcy94 ZnMveGZzX2ZzLmgJMjAwOC0wMS0yMSAxNjozNDowMC4wMDAwMDAwMDAgKzEx MDAKKysrIGIvZnMveGZzL3hmc19mcy5oCTIwMDgtMDEtMjEgMTY6MTg6MjMu NzQ4NjI2NTQ1ICsxMTAwCkBAIC0yMzksNyArMjM5LDkgQEAgdHlwZWRlZiBz dHJ1Y3QgeGZzX2Zzb3BfcmVzYmxrcyB7CiAjZGVmaW5lIFhGU19GU09QX0dF T01fRkxBR1NfTE9HVjIJMHgwMTAwCS8qIGxvZyBmb3JtYXQgdmVyc2lvbiAy CSovCiAjZGVmaW5lIFhGU19GU09QX0dFT01fRkxBR1NfU0VDVE9SCTB4MDIw MAkvKiBzZWN0b3Igc2l6ZXMgPjFCQgkqLwogI2RlZmluZSBYRlNfRlNPUF9H RU9NX0ZMQUdTX0FUVFIyCTB4MDQwMAkvKiBpbmxpbmUgYXR0cmlidXRlcyBy ZXdvcmsgKi8KKyNkZWZpbmUgWEZTX0ZTT1BfR0VPTV9GTEFHU19ESVJWMkNJ CTB4MTAwMAkvKiBBU0NJSSBvbmx5IENJIG5hbWVzICovCiAjZGVmaW5lIFhG U19GU09QX0dFT01fRkxBR1NfTEFaWVNCCTB4NDAwMAkvKiBsYXp5IHN1cGVy YmxvY2sgY291bnRlcnMgKi8KKyNkZWZpbmUgWEZTX0ZTT1BfR0VPTV9GTEFH U19VTklDT0RFCTB4MTAwMDAJLyogdW5pY29kZSBmaWxlbmFtZXMgKi8KIAog CiAvKgoKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09CmZzL3hmcy94 ZnNfZnNvcHMuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KCi0t LSBhL2ZzL3hmcy94ZnNfZnNvcHMuYwkyMDA4LTAxLTIxIDE2OjM0OjAwLjAw MDAwMDAwMCArMTEwMAorKysgYi9mcy94ZnMveGZzX2Zzb3BzLmMJMjAwOC0w MS0yMSAxNjoxMzoxMC42MDgyNzkzMTEgKzExMDAKQEAgLTk1LDEwICs5NSwx NCBAQCB4ZnNfZnNfZ2VvbWV0cnkoCiAJCQkJWEZTX0ZTT1BfR0VPTV9GTEFH U19ESVJWMiA6IDApIHwKIAkJCShYRlNfU0JfVkVSU0lPTl9IQVNTRUNUT1Io Jm1wLT5tX3NiKSA/CiAJCQkJWEZTX0ZTT1BfR0VPTV9GTEFHU19TRUNUT1Ig OiAwKSB8CisJCQkoeGZzX3NiX3ZlcnNpb25faGFzb2xkY2koJm1wLT5tX3Ni KSA/CisJCQkJWEZTX0ZTT1BfR0VPTV9GTEFHU19ESVJWMkNJIDogMCkgfAog CQkJKHhmc19zYl92ZXJzaW9uX2hhc2xhenlzYmNvdW50KCZtcC0+bV9zYikg PwogCQkJCVhGU19GU09QX0dFT01fRkxBR1NfTEFaWVNCIDogMCkgfAogCQkJ KFhGU19TQl9WRVJTSU9OX0hBU0FUVFIyKCZtcC0+bV9zYikgPwotCQkJCVhG U19GU09QX0dFT01fRkxBR1NfQVRUUjIgOiAwKTsKKwkJCQlYRlNfRlNPUF9H RU9NX0ZMQUdTX0FUVFIyIDogMCkgfAorCQkJKHhmc19zYl92ZXJzaW9uX2hh c3VuaWNvZGUoJm1wLT5tX3NiKSA/CisJCQkJWEZTX0ZTT1BfR0VPTV9GTEFH U19VTklDT0RFIDogMCk7CiAJCWdlby0+bG9nc2VjdHNpemUgPSBYRlNfU0Jf VkVSU0lPTl9IQVNTRUNUT1IoJm1wLT5tX3NiKSA/CiAJCQkJbXAtPm1fc2Iu c2JfbG9nc2VjdHNpemUgOiBCQlNJWkU7CiAJCWdlby0+cnRzZWN0c2l6ZSA9 IG1wLT5tX3NiLnNiX2Jsb2Nrc2l6ZTsK ------------cnxN6PYfs48WGnrhyS2w9D Content-Disposition: attachment; filename=ci_growfs_user.patch Content-Type: text/x-patch; name=ci_growfs_user.patch Content-Transfer-Encoding: Quoted-Printable Index: ci/xfsprogs/growfs/xfs_growfs.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/growfs/xfs_growfs.c 2008-01-17 12:46:36.000000000 +1100 +++ ci/xfsprogs/growfs/xfs_growfs.c 2008-01-21 16:28:58.581225955 +1100 @@ -59,7 +59,7 @@ char *logname, char *rtname, int lazycount, - int dirversion, + char *dirversion, int logversion, int attrversion) { @@ -68,7 +68,7 @@ " =3D%-22s sectsz=3D%-5u attr=3D%u\n" "data =3D%-22s bsize=3D%-6u blocks=3D%llu, imaxpct=3D%u\n" " =3D%-22s sunit=3D%-6u swidth=3D%u blks\n" - "naming =3Dversion %-14u bsize=3D%-6u\n" + "naming =3Dversion %-14s bsize=3D%-6u%s\n" "log =3D%-22s bsize=3D%-6u blocks=3D%u, version=3D%u\n" " =3D%-22s sectsz=3D%-5u sunit=3D%u blks, lazy-count=3D%u\n" "realtime =3D%-22s extsz=3D%-6u blocks=3D%llu, rtextents=3D%llu\n"), @@ -79,6 +79,7 @@ geo.imaxpct, "", geo.sunit, geo.swidth, dirversion, geo.dirblocksize, + geo.flags & XFS_FSOP_GEOM_FLAGS_UNICODE ? " utf8" : "", isint ? _("internal") : logname ? logname : _("external"), geo.blocksize, geo.logblocks, logversion, "", geo.logsectsize, geo.logsunit / geo.blocksize, lazycount, @@ -95,7 +96,7 @@ long long ddsize; /* device size in 512-byte blocks */ int dflag; /* -d flag */ int attrversion;/* attribute version number */ - int dirversion; /* directory version number */ + char *dirversion; /* directory version */ int logversion; /* log version number */ long long dlsize; /* device size in 512-byte blocks */ long long drsize; /* device size in 512-byte blocks */ @@ -235,7 +236,8 @@ } isint =3D geo.logstart > 0; lazycount =3D geo.flags & XFS_FSOP_GEOM_FLAGS_LAZYSB ? 1 : 0; - dirversion =3D geo.flags & XFS_FSOP_GEOM_FLAGS_DIRV2 ? 2 : 1; + dirversion =3D geo.flags & XFS_FSOP_GEOM_FLAGS_DIRV2CI ? "ci" : + geo.flags & XFS_FSOP_GEOM_FLAGS_DIRV2 ? "2" : "1"; logversion =3D geo.flags & XFS_FSOP_GEOM_FLAGS_LOGV2 ? 2 : 1; attrversion =3D geo.flags & XFS_FSOP_GEOM_FLAGS_ATTR2 ? 2 : \ (geo.flags & XFS_FSOP_GEOM_FLAGS_ATTR ? 1 : 0); Index: ci/xfsprogs/include/xfs_fs.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- ci.orig/xfsprogs/include/xfs_fs.h 2007-10-10 16:12:47.000000000 +1000 +++ ci/xfsprogs/include/xfs_fs.h 2008-01-21 16:18:09.726376630 +1100 @@ -241,7 +241,9 @@ #define XFS_FSOP_GEOM_FLAGS_LOGV2 0x0100 /* log format version 2 */ #define XFS_FSOP_GEOM_FLAGS_SECTOR 0x0200 /* sector sizes >1BB */ #define XFS_FSOP_GEOM_FLAGS_ATTR2 0x0400 /* inline attributes rework */ +#define XFS_FSOP_GEOM_FLAGS_DIRV2CI 0x1000 /* ASCII only CI names */ #define XFS_FSOP_GEOM_FLAGS_LAZYSB 0x4000 /* lazy superblock counters */ +#define XFS_FSOP_GEOM_FLAGS_UNICODE 0x10000 /* unicode filenames */ =20 =20 /* ------------cnxN6PYfs48WGnrhyS2w9D-- From owner-xfs@oss.sgi.com Sun Jan 20 21:44:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 21:44:32 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L5iOVB018908 for ; Sun, 20 Jan 2008 21:44:27 -0800 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA25035; Mon, 21 Jan 2008 16:44:38 +1100 Received: by chook.melbourne.sgi.com (Postfix, from userid 1161) id 1D03B58C4C0F; Mon, 21 Jan 2008 16:44:38 +1100 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 970652 - It's possible for an empty directory to be undeletable Message-Id: <20080121054438.1D03B58C4C0F@chook.melbourne.sgi.com> Date: Mon, 21 Jan 2008 16:44:38 +1100 (EST) From: bnaujok@sgi.com (Barry Naujok) X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14233 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Make sure "." and ".." are the first two entries in a directory Date: Mon Jan 21 16:44:01 AEDT 2008 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/xfs-cmds Inspected by: bnaujok The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:30385a xfsprogs/repair/phase6.c - 1.41 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/repair/phase6.c.diff?r1=text&tr1=1.41&r2=text&tr2=1.40&f=h xfsprogs/repair/incore_ino.c - 1.17 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/repair/incore_ino.c.diff?r1=text&tr1=1.17&r2=text&tr2=1.16&f=h - Make sure "." and ".." are the first two entries in a directory From owner-xfs@oss.sgi.com Sun Jan 20 21:53:14 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 21:53:18 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L5r8HV019813 for ; Sun, 20 Jan 2008 21:53:13 -0800 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA25256; Mon, 21 Jan 2008 16:53:24 +1100 Received: by chook.melbourne.sgi.com (Postfix, from userid 1161) id 1174D58C4C0F; Mon, 21 Jan 2008 16:53:23 +1100 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 976039 - xfs_info can't handle mount points with spaces Message-Id: <20080121055324.1174D58C4C0F@chook.melbourne.sgi.com> Date: Mon, 21 Jan 2008 16:53:23 +1100 (EST) From: bnaujok@sgi.com (Barry Naujok) X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14234 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Make xfs_info handle mount points with spaces Date: Mon Jan 21 16:53:01 AEDT 2008 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/xfs-cmds Inspected by: sandeen@sandeen.net The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:30386a xfsprogs/growfs/xfs_info.sh - 1.9 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/growfs/xfs_info.sh.diff?r1=text&tr1=1.9&r2=text&tr2=1.8&f=h - Make xfs_info handle mount points with spaces From owner-xfs@oss.sgi.com Sun Jan 20 22:01:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 22:01:44 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L61aYw020637 for ; Sun, 20 Jan 2008 22:01:38 -0800 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA25480; Mon, 21 Jan 2008 17:01:51 +1100 Received: by chook.melbourne.sgi.com (Postfix, from userid 1161) id 2EAD558C4C0F; Mon, 21 Jan 2008 17:01:51 +1100 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 975550 - xfs_repair - bad freespace btree extent can cause internal corruption and die Message-Id: <20080121060151.2EAD558C4C0F@chook.melbourne.sgi.com> Date: Mon, 21 Jan 2008 17:01:51 +1100 (EST) From: bnaujok@sgi.com (Barry Naujok) X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14235 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Verify end of freespace btree extent is valid Date: Mon Jan 21 17:01:27 AEDT 2008 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/xfs-cmds Inspected by: donaldd@sgi.com The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:30388a xfsprogs/repair/scan.c - 1.20 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/repair/scan.c.diff?r1=text&tr1=1.20&r2=text&tr2=1.19&f=h - Verify end of freespace btree extent is valid From owner-xfs@oss.sgi.com Sun Jan 20 22:54:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 22:54:32 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0L6sOA9024794 for ; Sun, 20 Jan 2008 22:54:28 -0800 X-ASG-Debug-ID: 1200898483-0c3200350000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from pentafluge.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7099F53EE2A; Sun, 20 Jan 2008 22:54:44 -0800 (PST) Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by cuda.sgi.com with ESMTP id KsGAFCoo74FmNYRt; Sun, 20 Jan 2008 22:54:44 -0800 (PST) Received: from hch by pentafluge.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1JGqYM-0008Ha-8C; Mon, 21 Jan 2008 06:54:42 +0000 Date: Mon, 21 Jan 2008 06:54:42 +0000 From: Christoph Hellwig To: David Chinner Cc: Christoph Hellwig , "Josef 'Jeff' Sipek" , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/1] XFS: Replace custom AIL linked-list code with struct list_head Subject: Re: [PATCH 1/1] XFS: Replace custom AIL linked-list code with struct list_head Message-ID: <20080121065442.GA31816@infradead.org> References: <1200875757-26598-1-git-send-email-jeffpc@josefsipek.net> <20080121040422.GA25541@infradead.org> <20080121041258.GZ155259@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080121041258.GZ155259@sgi.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: pentafluge.infradead.org[213.146.154.40] X-Barracuda-Start-Time: 1200898484 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40053 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14236 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Mon, Jan 21, 2008 at 03:12:58PM +1100, David Chinner wrote: > Doesn't really make any difference to me - i've got to rebase the patch > on the xfsaild thread commit anyway.... Ok, then I'm all for putting it in. Especially as it should help detangling the header mess. IIRC after this patch there is no need anymore to pull in xfs_trans.h before xfs_mount.h anymore. From owner-xfs@oss.sgi.com Sun Jan 20 23:07:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 23:07:43 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L77Xwx026071 for ; Sun, 20 Jan 2008 23:07:37 -0800 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA26631; Mon, 21 Jan 2008 18:07:47 +1100 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id E4F9558C4C10; Mon, 21 Jan 2008 18:07:46 +1100 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: PARTIAL TAKE 971186 - stop updating inode->i_blocks Message-Id: <20080121070746.E4F9558C4C10@chook.melbourne.sgi.com> Date: Mon, 21 Jan 2008 18:07:46 +1100 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14237 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs stop updating inode->i_blocks The VFS doesn't use i_blocks, it's only used by generic_fillattr and the generic quota code which XFS doesn't use. In XFS there is one use to check whether we have an inline or out of line sumlink, but we can replace that with a check of the XFS_IFINLINE inode flag. Signed-off-by: Christoph Hellwig Date: Mon Jan 21 18:07:03 AEDT 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-hch Inspected by: Christoph Hellwig 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:30391a fs/xfs/xfs_vnodeops.c - 1.730 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.730&r2=text&tr2=1.729&f=h fs/xfs/linux-2.6/xfs_vnode.c - 1.154 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.c.diff?r1=text&tr1=1.154&r2=text&tr2=1.153&f=h fs/xfs/linux-2.6/xfs_super.c - 1.406 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.406&r2=text&tr2=1.405&f=h fs/xfs/linux-2.6/xfs_iops.c - 1.274 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_iops.c.diff?r1=text&tr1=1.274&r2=text&tr2=1.273&f=h fs/xfs/dmapi/xfs_dm.c - 1.63 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/dmapi/xfs_dm.c.diff?r1=text&tr1=1.63&r2=text&tr2=1.62&f=h - stop updating inode->i_blocks From owner-xfs@oss.sgi.com Sun Jan 20 23:10:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 23:10:17 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L7A72P026565 for ; Sun, 20 Jan 2008 23:10:10 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA26671; Mon, 21 Jan 2008 18:10:20 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0L7AILF32525312; Mon, 21 Jan 2008 18:10:19 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0L7AG5s32473120; Mon, 21 Jan 2008 18:10:16 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Mon, 21 Jan 2008 18:10:16 +1100 From: David Chinner To: Christoph Hellwig Cc: David Chinner , "Josef 'Jeff' Sipek" , xfs@oss.sgi.com Subject: Re: [PATCH 1/1] XFS: Replace custom AIL linked-list code with struct list_head Message-ID: <20080121071016.GI155259@sgi.com> References: <1200875757-26598-1-git-send-email-jeffpc@josefsipek.net> <20080121040422.GA25541@infradead.org> <20080121041258.GZ155259@sgi.com> <20080121065442.GA31816@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080121065442.GA31816@infradead.org> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14238 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Mon, Jan 21, 2008 at 06:54:42AM +0000, Christoph Hellwig wrote: > On Mon, Jan 21, 2008 at 03:12:58PM +1100, David Chinner wrote: > > Doesn't really make any difference to me - i've got to rebase the patch > > on the xfsaild thread commit anyway.... > > Ok, then I'm all for putting it in. Especially as it should help > detangling the header mess. IIRC after this patch there is no need > anymore to pull in xfs_trans.h before xfs_mount.h anymore. Ok, I'll look at that.... Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Sun Jan 20 23:14:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 23:14:02 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L7DtPA027219 for ; Sun, 20 Jan 2008 23:13:58 -0800 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA26722; Mon, 21 Jan 2008 18:14:11 +1100 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id E5FCE58C4C10; Mon, 21 Jan 2008 18:14:10 +1100 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: PARTIAL TAKE 971186 - keep i_nlink updated and use proper accessors Message-Id: <20080121071410.E5FCE58C4C10@chook.melbourne.sgi.com> Date: Mon, 21 Jan 2008 18:14:10 +1100 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14239 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs keep i_nlink updated and use proper accessors To get the read-only bind mounts in -mm to work correctly with XFS we need to call the drop_nlink and inc_nlink helpers to monitor the link count. Add calls to these to xfs_bumplink and xfs_droplink and stop copying over di_nlink to i_nlink in xfs_validate_fields and vn_revalidate. Signed-off-by: Christoph Hellwig Date: Mon Jan 21 18:13:29 AEDT 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-hch Inspected by: Christoph Hellwig 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:30392a fs/xfs/xfs_utils.c - 1.79 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_utils.c.diff?r1=text&tr1=1.79&r2=text&tr2=1.78&f=h fs/xfs/linux-2.6/xfs_vnode.c - 1.155 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.c.diff?r1=text&tr1=1.155&r2=text&tr2=1.154&f=h fs/xfs/linux-2.6/xfs_iops.c - 1.275 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_iops.c.diff?r1=text&tr1=1.275&r2=text&tr2=1.274&f=h - keep i_nlink updated and use proper accessors From owner-xfs@oss.sgi.com Sun Jan 20 23:18:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jan 2008 23:18:18 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0L7IAbT028066 for ; Sun, 20 Jan 2008 23:18:14 -0800 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA26894; Mon, 21 Jan 2008 18:18:25 +1100 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id E026C58C4C10; Mon, 21 Jan 2008 18:18:24 +1100 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: PARTIAL TAKE 971186 - kill xfs_root Message-Id: <20080121071824.E026C58C4C10@chook.melbourne.sgi.com> Date: Mon, 21 Jan 2008 18:18:24 +1100 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/5505/Sun Jan 20 15:48:59 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14240 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs kill xfs_root The only caller (xfs_fs_fill_super) can simplify call igrab on the root inode. Signed-off-by: Christoph Hellwig Date: Mon Jan 21 18:17:52 AEDT 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-hch Inspected by: Christoph Hellwig 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:30393a fs/xfs/xfs_vfsops.c - 1.550 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vfsops.c.diff?r1=text&tr1=1.550&r2=text&tr2=1.549&f=h fs/xfs/linux-2.6/xfs_super.c - 1.407 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.407&r2=text&tr2=1.406&f=h fs/xfs/linux-2.6/xfs_ksyms.c - 1.78 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_ksyms.c.diff?r1=text&tr1=1.78&r2=text&tr2=1.77&f=h fs/xfs/xfs_vfsops.h - 1.8 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vfsops.h.diff?r1=text&tr1=1.8&r2=text&tr2=1.7&f=h - kill xfs_root From owner-xfs@oss.sgi.com Mon Jan 21 08:52:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jan 2008 08:52:23 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0LGqF7k017288 for ; Mon, 21 Jan 2008 08:52:17 -0800 X-ASG-Debug-ID: 1200934354-1b0c034b0000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ishtar.tlinx.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3421DCB25EF for ; Mon, 21 Jan 2008 08:52:34 -0800 (PST) Received: from ishtar.tlinx.org (ishtar.tlinx.org [64.81.245.74]) by cuda.sgi.com with ESMTP id AFwYya3YbNw3Gg2Z for ; Mon, 21 Jan 2008 08:52:34 -0800 (PST) Received: from [192.168.3.11] (Athena [192.168.3.11]) by ishtar.tlinx.org (8.13.3/8.12.10/SuSE Linux 0.7) with ESMTP id m0LGQeSv008929; Mon, 21 Jan 2008 08:26:40 -0800 Message-ID: <4794C7C0.8030207@tlinx.org> Date: Mon, 21 Jan 2008 08:26:40 -0800 From: Linda Walsh User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Peter Zijlstra CC: LKML , Linux-Xfs X-ASG-Orig-Subj: Re: Known prob: MAX_LOCK_DEPTH too low? Subject: Re: Known prob: MAX_LOCK_DEPTH too low? References: <47914FA7.1000807@tlinx.org> <1200918448.6341.5.camel@lappy> In-Reply-To: <1200918448.6341.5.camel@lappy> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: ishtar.tlinx.org[64.81.245.74] X-Barracuda-Start-Time: 1200934355 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40091 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5507/Mon Jan 21 06:34:07 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14241 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lkml@tlinx.org Precedence: bulk X-list: xfs Peter Zijlstra wrote: > On Fri, 2008-01-18 at 17:17 -0800, Linda Walsh wrote: > >> On my x86_64 machine, I got the following message >> in log (kern = 2.6.23.14) >> >> Jan 16 04:08:38 Astara kernel: BUG: MAX_LOCK_DEPTH too low! >> Jan 16 04:08:38 Astara kernel: turning off the locking correctness >> validator. >> >> Have no idea what caused it as I found the message on my console >> somewhat after the fact. The system had been up over 24 hours and >> is still running. System still seems 'fine' (been up 3 days now), >> so you can treat this as a "data point". >> > > Are you perhaps an XFS user? > > ---- Funny you should mention that... yes. However, there were no other messages that seem to indicate that the message had anything to do with XFS. Nice shot in the dark. From owner-xfs@oss.sgi.com Mon Jan 21 09:14:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jan 2008 09:14:09 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0LHE0u5018758 for ; Mon, 21 Jan 2008 09:14:03 -0800 X-ASG-Debug-ID: 1200935660-1b0203650000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7FE04CB275B for ; Mon, 21 Jan 2008 09:14:20 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id rttnTGE2kfDAHyYI for ; Mon, 21 Jan 2008 09:14:20 -0800 (PST) Received: from f237116.upc-f.chello.nl ([80.56.237.116] helo=lappy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.68 #1 (Red Hat Linux)) id 1JH0DS-0001kO-Bj; Mon, 21 Jan 2008 17:13:46 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lappy.programming.kicks-ass.net (Postfix) with ESMTP id 7AB9D5C416D; Mon, 21 Jan 2008 18:13:49 +0100 (CET) X-ASG-Orig-Subj: Re: Known prob: MAX_LOCK_DEPTH too low? Subject: Re: Known prob: MAX_LOCK_DEPTH too low? From: Peter Zijlstra To: Linda Walsh Cc: LKML , Linux-Xfs , Ingo Molnar In-Reply-To: <4794C7C0.8030207@tlinx.org> References: <47914FA7.1000807@tlinx.org> <1200918448.6341.5.camel@lappy> <4794C7C0.8030207@tlinx.org> Content-Type: text/plain Date: Mon, 21 Jan 2008 18:13:49 +0100 Message-Id: <1200935629.6341.9.camel@lappy> Mime-Version: 1.0 X-Mailer: Evolution 2.21.5 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1200935660 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40093 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5507/Mon Jan 21 06:34:07 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14242 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: a.p.zijlstra@chello.nl Precedence: bulk X-list: xfs On Mon, 2008-01-21 at 08:26 -0800, Linda Walsh wrote: > Peter Zijlstra wrote: > > On Fri, 2008-01-18 at 17:17 -0800, Linda Walsh wrote: > > > >> On my x86_64 machine, I got the following message > >> in log (kern = 2.6.23.14) > >> > >> Jan 16 04:08:38 Astara kernel: BUG: MAX_LOCK_DEPTH too low! > >> Jan 16 04:08:38 Astara kernel: turning off the locking correctness > >> validator. > >> > >> Have no idea what caused it as I found the message on my console > >> somewhat after the fact. The system had been up over 24 hours and > >> is still running. System still seems 'fine' (been up 3 days now), > >> so you can treat this as a "data point". > >> > > > > Are you perhaps an XFS user? > > > > > ---- > Funny you should mention that... yes. However, there were no > other messages that seem to indicate that the message had anything > to do with XFS. Nice shot in the dark. :-), know issue, I guess I'll up the MAX_LOCK_DEPTH for the next release. I looked at dynamically allocating that stuff, but that gets awfully painful. From owner-xfs@oss.sgi.com Mon Jan 21 18:27:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jan 2008 18:27:51 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0M2RZuc023689 for ; Mon, 21 Jan 2008 18:27:40 -0800 Received: from timothy-shimmins-power-mac-g5.local (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA22563; Tue, 22 Jan 2008 13:27:37 +1100 Message-ID: <479554B3.70003@sgi.com> Date: Tue, 22 Jan 2008 13:28:03 +1100 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Niv Sardi CC: Eric Sandeen , xfs-oss Subject: Re: small problem w/ new xfs defaults patch References: <4794159F.9070505@sandeen.net> <20080121051341.GA31708862@melbourne.sgi.com> In-Reply-To: <20080121051341.GA31708862@melbourne.sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/5516/Mon Jan 21 16:29:15 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14243 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Niv Sardi wrote: > * Eric Sandeen [2008-01-20 21:46:39 -0600]: > >> Index: xfsprogs-2.9.4/growfs/xfs_growfs.c >> =================================================================== > [...] >> couple things... you lost a "\n" off the end of the data section there... > > That has been fixed, I guess it needs to be sent to oss (barry?) > >> Also, do you really want to drop reporting of unwritten extents? Even >> if you're disallowing the selection on new mkfs's there may still be >> different flavors of filesystems in existence, should it still be reported? > > I don't really care, whatever the oss/xfs-master people like best. > > Cheers My preference would be to report the unwritten extent flag as Eric suggested. --Tim From owner-xfs@oss.sgi.com Mon Jan 21 19:39:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jan 2008 19:39:32 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0M3cpV3031468 for ; Mon, 21 Jan 2008 19:39:02 -0800 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA24866; Tue, 22 Jan 2008 14:38:47 +1100 Message-ID: <47956615.90700@sgi.com> Date: Tue, 22 Jan 2008 14:42:13 +1100 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.9 (X11/20071031) MIME-Version: 1.0 To: David Chinner CC: xfs-dev , xfs-oss Subject: Re: [patch] reduce log I/O latency V2 References: <20080121041649.GA155259@sgi.com> In-Reply-To: <20080121041649.GA155259@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/5516/Mon Jan 21 16:29:15 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14244 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Looks good Dave. Shouldn't we also tag the second buffer in the split log write case? David Chinner wrote: > Reduce log I/O latency > > To ensure that log I/O is issued as the highest priority I/O, set > the I/O priority of the log I/O to the highest possible. This will > ensure that log I/O is not held up behind bulk data or other > metadata I/O as delaying log I/O can pause the entire transaction > subsystem. Introduce a new buffer flag to allow us to tag the log > buffers so we can discriminate when issuing the I/O. > > Version 2: > - don't use realtime priority class > > Signed-off-by: Dave Chinner > --- > fs/xfs/linux-2.6/xfs_buf.c | 3 +++ > fs/xfs/linux-2.6/xfs_buf.h | 5 ++++- > fs/xfs/xfs_log.c | 2 ++ > 3 files changed, 9 insertions(+), 1 deletion(-) > > Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_buf.c 2007-12-19 01:39:42.286538135 +1100 > +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c 2007-12-19 11:56:47.977477993 +1100 > @@ -1198,6 +1198,9 @@ next_chunk: > > submit_io: > if (likely(bio->bi_size)) { > + /* log I/O should not be delayed by anything except realtime. */ > + if (bp->b_flags & XBF_LOG_BUFFER) > + bio_set_prio(bio, IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 0)); > submit_bio(rw, bio); > if (size) > goto next_chunk; > Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.h > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_buf.h 2007-12-19 01:11:16.871181483 +1100 > +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.h 2007-12-19 11:55:09.642183801 +1100 > @@ -53,7 +53,8 @@ typedef enum { > XBF_DELWRI = (1 << 6), /* buffer has dirty pages */ > XBF_STALE = (1 << 7), /* buffer has been staled, do not find it */ > XBF_FS_MANAGED = (1 << 8), /* filesystem controls freeing memory */ > - XBF_ORDERED = (1 << 11), /* use ordered writes */ > + XBF_LOG_BUFFER = (1 << 9), /* Buffer issued by the log */ > + XBF_ORDERED = (1 << 11), /* use ordered writes */ > XBF_READ_AHEAD = (1 << 12), /* asynchronous read-ahead */ > > /* flags used only as arguments to access routines */ > @@ -339,6 +340,8 @@ extern void xfs_buf_trace(xfs_buf_t *, c > #define XFS_BUF_TARGET(bp) ((bp)->b_target) > #define XFS_BUFTARG_NAME(target) xfs_buf_target_name(target) > > +#define XFS_BUF_SET_LOGBUF(bp) ((bp)->b_flags |= XBF_LOG_BUFFER) > + > static inline int xfs_bawrite(void *mp, xfs_buf_t *bp) > { > bp->b_fspriv3 = mp; > Index: 2.6.x-xfs-new/fs/xfs/xfs_log.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/xfs_log.c 2007-12-19 01:11:16.871181483 +1100 > +++ 2.6.x-xfs-new/fs/xfs/xfs_log.c 2007-12-19 11:55:09.698176566 +1100 > @@ -1443,6 +1443,8 @@ xlog_sync(xlog_t *log, > XFS_BUF_ZEROFLAGS(bp); > XFS_BUF_BUSY(bp); > XFS_BUF_ASYNC(bp); > + XFS_BUF_SET_LOGBUF(bp); > + > /* > * Do an ordered write for the log block. > * Its unnecessary to flush the first split block in the log wrap case. > From owner-xfs@oss.sgi.com Mon Jan 21 19:47:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jan 2008 19:47:25 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0M3lERF032756 for ; Mon, 21 Jan 2008 19:47:19 -0800 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA25209; Tue, 22 Jan 2008 14:47:22 +1100 Message-ID: <47956818.1010808@sgi.com> Date: Tue, 22 Jan 2008 14:50:48 +1100 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.9 (X11/20071031) MIME-Version: 1.0 To: David Chinner CC: xfs-dev , xfs-oss Subject: Re: [patch] Use BIO_META tags for metadata rather than BIO_SYNC References: <20080121041826.GB155259@sgi.com> In-Reply-To: <20080121041826.GB155259@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/5516/Mon Jan 21 16:29:15 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14245 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Looks good. David Chinner wrote: > Improve metadata I/O merging in the elevator > > Change all async metadata buffers to use [READ|WRITE]_META I/O types > so that the I/O doesn't get issued immediately. This allows merging > of adjacent metadata requests but still prioritises them over bulk > data. This shows a 10-15% improvement in sequential create speed of > small files. > > Don't include the log buffers in this classification - leave them > as sync types so they are issued immediately. > > Signed-off-by: Dave Chinner > --- > fs/xfs/linux-2.6/xfs_buf.c | 6 +++++- > include/linux/fs.h | 1 + > 2 files changed, 6 insertions(+), 1 deletion(-) > > Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_buf.c 2007-12-19 11:56:47.977477993 +1100 > +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c 2007-12-19 11:56:52.200932303 +1100 > @@ -1136,10 +1136,14 @@ _xfs_buf_ioapply( > if (bp->b_flags & XBF_ORDERED) { > ASSERT(!(bp->b_flags & XBF_READ)); > rw = WRITE_BARRIER; > - } else if (bp->b_flags & _XBF_RUN_QUEUES) { > + } else if (bp->b_flags & XBF_LOG_BUFFER) { > ASSERT(!(bp->b_flags & XBF_READ_AHEAD)); > bp->b_flags &= ~_XBF_RUN_QUEUES; > rw = (bp->b_flags & XBF_WRITE) ? WRITE_SYNC : READ_SYNC; > + } else if (bp->b_flags & _XBF_RUN_QUEUES) { > + ASSERT(!(bp->b_flags & XBF_READ_AHEAD)); > + bp->b_flags &= ~_XBF_RUN_QUEUES; > + rw = (bp->b_flags & XBF_WRITE) ? WRITE_META : READ_META; > } else { > rw = (bp->b_flags & XBF_WRITE) ? WRITE : > (bp->b_flags & XBF_READ_AHEAD) ? READA : READ; > Index: 2.6.x-xfs-new/include/linux/fs.h > =================================================================== > --- 2.6.x-xfs-new.orig/include/linux/fs.h 2007-12-19 01:11:16.495229881 +1100 > +++ 2.6.x-xfs-new/include/linux/fs.h 2007-12-19 11:56:52.352912667 +1100 > @@ -83,6 +83,7 @@ extern int dir_notify_enable; > #define READ_SYNC (READ | (1 << BIO_RW_SYNC)) > #define READ_META (READ | (1 << BIO_RW_META)) > #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) > +#define WRITE_META (WRITE | (1 << BIO_RW_META)) > #define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) > > #define SEL_IN 1 > > > From owner-xfs@oss.sgi.com Mon Jan 21 19:58:09 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jan 2008 19:58:12 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0M3w2Nw002054 for ; Mon, 21 Jan 2008 19:58:06 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA25362; Tue, 22 Jan 2008 14:58:21 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0M3wJLF34197838; Tue, 22 Jan 2008 14:58:20 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0M3wIpV34168802; Tue, 22 Jan 2008 14:58:18 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Tue, 22 Jan 2008 14:58:17 +1100 From: David Chinner To: Lachlan McIlroy Cc: David Chinner , xfs-dev , xfs-oss Subject: Re: [patch] reduce log I/O latency V2 Message-ID: <20080122035817.GT155259@sgi.com> References: <20080121041649.GA155259@sgi.com> <47956615.90700@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47956615.90700@sgi.com> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5516/Mon Jan 21 16:29:15 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14246 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Tue, Jan 22, 2008 at 02:42:13PM +1100, Lachlan McIlroy wrote: > Looks good Dave. Shouldn't we also tag the second buffer in the > split log write case? Hmm - I thought it was being tagged. looks like I missed a reject on my last set of patch re-orderings - updated patch attached. --- Reduce log I/O latency To ensure that log I/O is issued as the highest priority I/O, set the I/O priority of the log I/O to the highest possible. This will ensure that log I/O is not held up behind bulk data or other metadata I/O as delaying log I/O can pause the entire transaction subsystem. Introduce a new buffer flag to allow us to tag the log buffers so we can discriminate when issuing the I/O. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_buf.c | 3 +++ fs/xfs/linux-2.6/xfs_buf.h | 5 ++++- fs/xfs/xfs_log.c | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_buf.c 2008-01-18 19:13:07.499131222 +1100 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c 2008-01-22 14:56:58.738098626 +1100 @@ -1198,6 +1198,9 @@ next_chunk: submit_io: if (likely(bio->bi_size)) { + /* log I/O should not be delayed by anything except realtime. */ + if (bp->b_flags & XBF_LOG_BUFFER) + bio_set_prio(bio, IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 0)); submit_bio(rw, bio); if (size) goto next_chunk; Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.h =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_buf.h 2008-01-18 19:13:07.503130710 +1100 +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.h 2008-01-18 19:13:29.448320166 +1100 @@ -53,7 +53,8 @@ typedef enum { XBF_DELWRI = (1 << 6), /* buffer has dirty pages */ XBF_STALE = (1 << 7), /* buffer has been staled, do not find it */ XBF_FS_MANAGED = (1 << 8), /* filesystem controls freeing memory */ - XBF_ORDERED = (1 << 11), /* use ordered writes */ + XBF_LOG_BUFFER = (1 << 9), /* Buffer issued by the log */ + XBF_ORDERED = (1 << 11), /* use ordered writes */ XBF_READ_AHEAD = (1 << 12), /* asynchronous read-ahead */ /* flags used only as arguments to access routines */ @@ -339,6 +340,8 @@ extern void xfs_buf_trace(xfs_buf_t *, c #define XFS_BUF_TARGET(bp) ((bp)->b_target) #define XFS_BUFTARG_NAME(target) xfs_buf_target_name(target) +#define XFS_BUF_SET_LOGBUF(bp) ((bp)->b_flags |= XBF_LOG_BUFFER) + static inline int xfs_bawrite(void *mp, xfs_buf_t *bp) { bp->b_fspriv3 = mp; Index: 2.6.x-xfs-new/fs/xfs/xfs_log.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_log.c 2008-01-18 19:13:07.519128661 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_log.c 2008-01-22 14:56:57.550673091 +1100 @@ -1462,6 +1462,8 @@ xlog_sync(xlog_t *log, XFS_BUF_ZEROFLAGS(bp); XFS_BUF_BUSY(bp); XFS_BUF_ASYNC(bp); + XFS_BUF_SET_LOGBUF(bp); + /* * Do an ordered write for the log block. * Its unnecessary to flush the first split block in the log wrap case. @@ -1499,6 +1501,7 @@ xlog_sync(xlog_t *log, XFS_BUF_ZEROFLAGS(bp); XFS_BUF_BUSY(bp); XFS_BUF_ASYNC(bp); + XFS_BUF_SET_LOGBUF(bp); if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) XFS_BUF_ORDERED(bp); dptr = XFS_BUF_PTR(bp); From owner-xfs@oss.sgi.com Mon Jan 21 21:04:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jan 2008 21:04:13 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0M541cu012094 for ; Mon, 21 Jan 2008 21:04:06 -0800 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA27020; Tue, 22 Jan 2008 16:04:14 +1100 Message-ID: <47957A1C.3060806@sgi.com> Date: Tue, 22 Jan 2008 16:07:40 +1100 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.9 (X11/20071031) MIME-Version: 1.0 To: David Chinner CC: xfs-dev , xfs-oss Subject: Re: [patch] reduce log I/O latency V2 References: <20080121041649.GA155259@sgi.com> <47956615.90700@sgi.com> <20080122035817.GT155259@sgi.com> In-Reply-To: <20080122035817.GT155259@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/5516/Mon Jan 21 16:29:15 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14247 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Yup, all good now. David Chinner wrote: > On Tue, Jan 22, 2008 at 02:42:13PM +1100, Lachlan McIlroy wrote: >> Looks good Dave. Shouldn't we also tag the second buffer in the >> split log write case? > > Hmm - I thought it was being tagged. looks like I missed a reject > on my last set of patch re-orderings - updated patch attached. > > --- > > Reduce log I/O latency > > To ensure that log I/O is issued as the highest priority I/O, set > the I/O priority of the log I/O to the highest possible. This will > ensure that log I/O is not held up behind bulk data or other > metadata I/O as delaying log I/O can pause the entire transaction > subsystem. Introduce a new buffer flag to allow us to tag the log > buffers so we can discriminate when issuing the I/O. > > Signed-off-by: Dave Chinner > --- > fs/xfs/linux-2.6/xfs_buf.c | 3 +++ > fs/xfs/linux-2.6/xfs_buf.h | 5 ++++- > fs/xfs/xfs_log.c | 3 +++ > 3 files changed, 10 insertions(+), 1 deletion(-) > > Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_buf.c 2008-01-18 19:13:07.499131222 +1100 > +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c 2008-01-22 14:56:58.738098626 +1100 > @@ -1198,6 +1198,9 @@ next_chunk: > > submit_io: > if (likely(bio->bi_size)) { > + /* log I/O should not be delayed by anything except realtime. */ > + if (bp->b_flags & XBF_LOG_BUFFER) > + bio_set_prio(bio, IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 0)); > submit_bio(rw, bio); > if (size) > goto next_chunk; > Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.h > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_buf.h 2008-01-18 19:13:07.503130710 +1100 > +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.h 2008-01-18 19:13:29.448320166 +1100 > @@ -53,7 +53,8 @@ typedef enum { > XBF_DELWRI = (1 << 6), /* buffer has dirty pages */ > XBF_STALE = (1 << 7), /* buffer has been staled, do not find it */ > XBF_FS_MANAGED = (1 << 8), /* filesystem controls freeing memory */ > - XBF_ORDERED = (1 << 11), /* use ordered writes */ > + XBF_LOG_BUFFER = (1 << 9), /* Buffer issued by the log */ > + XBF_ORDERED = (1 << 11), /* use ordered writes */ > XBF_READ_AHEAD = (1 << 12), /* asynchronous read-ahead */ > > /* flags used only as arguments to access routines */ > @@ -339,6 +340,8 @@ extern void xfs_buf_trace(xfs_buf_t *, c > #define XFS_BUF_TARGET(bp) ((bp)->b_target) > #define XFS_BUFTARG_NAME(target) xfs_buf_target_name(target) > > +#define XFS_BUF_SET_LOGBUF(bp) ((bp)->b_flags |= XBF_LOG_BUFFER) > + > static inline int xfs_bawrite(void *mp, xfs_buf_t *bp) > { > bp->b_fspriv3 = mp; > Index: 2.6.x-xfs-new/fs/xfs/xfs_log.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/xfs_log.c 2008-01-18 19:13:07.519128661 +1100 > +++ 2.6.x-xfs-new/fs/xfs/xfs_log.c 2008-01-22 14:56:57.550673091 +1100 > @@ -1462,6 +1462,8 @@ xlog_sync(xlog_t *log, > XFS_BUF_ZEROFLAGS(bp); > XFS_BUF_BUSY(bp); > XFS_BUF_ASYNC(bp); > + XFS_BUF_SET_LOGBUF(bp); > + > /* > * Do an ordered write for the log block. > * Its unnecessary to flush the first split block in the log wrap case. > @@ -1499,6 +1501,7 @@ xlog_sync(xlog_t *log, > XFS_BUF_ZEROFLAGS(bp); > XFS_BUF_BUSY(bp); > XFS_BUF_ASYNC(bp); > + XFS_BUF_SET_LOGBUF(bp); > if (log->l_mp->m_flags & XFS_MOUNT_BARRIER) > XFS_BUF_ORDERED(bp); > dptr = XFS_BUF_PTR(bp); > > > From owner-xfs@oss.sgi.com Mon Jan 21 22:11:40 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jan 2008 22:11:47 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0M6BZqO017463 for ; Mon, 21 Jan 2008 22:11:39 -0800 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA28427; Tue, 22 Jan 2008 17:11:51 +1100 Received: by chook.melbourne.sgi.com (Postfix, from userid 1161) id E56A458C4C10; Tue, 22 Jan 2008 17:11:50 +1100 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 907752 - Fix metadump build warning Message-Id: <20080122061150.E56A458C4C10@chook.melbourne.sgi.com> Date: Tue, 22 Jan 2008 17:11:50 +1100 (EST) From: bnaujok@sgi.com (Barry Naujok) X-Virus-Scanned: ClamAV 0.91.2/5519/Mon Jan 21 20:46:17 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14248 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Date: Tue Jan 22 17:11:21 AEDT 2008 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/xfs-cmds Inspected by: nathans@debian.org The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:30411a xfsprogs/debian/changelog - 1.152 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/debian/changelog.diff?r1=text&tr1=1.152&r2=text&tr2=1.151&f=h - Update debian changelog xfsprogs/db/metadump.c - 1.3 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/db/metadump.c.diff?r1=text&tr1=1.3&r2=text&tr2=1.2&f=h - Fix metadump build warning From owner-xfs@oss.sgi.com Tue Jan 22 04:12:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jan 2008 04:12:03 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.8 required=5.0 tests=BAYES_40,RCVD_IN_PSBL autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0MCBvSv030333 for ; Tue, 22 Jan 2008 04:12:00 -0800 X-ASG-Debug-ID: 1201003936-11ab02a50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp3.vol.cz (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B22A2545855 for ; Tue, 22 Jan 2008 04:12:16 -0800 (PST) Received: from smtp3.vol.cz (smtp3.vol.cz [195.250.128.83]) by cuda.sgi.com with ESMTP id F9B0PkPrJbFCHROT for ; Tue, 22 Jan 2008 04:12:16 -0800 (PST) X-ASG-Whitelist: Client Received: from webmail2.vol.cz (webmail2.vol.cz [195.250.155.227]) by smtp3.vol.cz (Postfix) with ESMTP id E29445971E for ; Tue, 22 Jan 2008 13:11:43 +0100 (CET) Received: from webmail2.vol.cz (localhost.vol.cz [127.0.0.1]) by webmail2.vol.cz (8.13.8/8.13.8) with ESMTP id m0MCBhKg018818 for ; Tue, 22 Jan 2008 13:11:43 +0100 (CET) (envelope-from vtech@volny.cz) Received: (from www@localhost) by webmail2.vol.cz (8.13.8/8.13.8/Submit) id m0MCBh2j018817; Tue, 22 Jan 2008 13:11:43 +0100 (CET) (envelope-from vtech@volny.cz) Received: from 89-24-26-56.4ginternet.cz (89-24-26-56.4ginternet.cz [89.24.26.56]) by www2.mail.volny.cz (www2.mail.volny.cz [195.250.155.195]) with HTTP; Tue, 22 Jan 2008 13:11:43 +0100 (CET) MIME-Version: 1.0 X-ASG-Orig-Subj: =?iso-8859-2?Q?XFS_on_LVM2=2C_1st_drive_lost?= Subject: =?iso-8859-2?Q?XFS_on_LVM2=2C_1st_drive_lost?= From: vtech@volny.cz X-Originating-Account: vtech/volny.cz To: xfs@oss.sgi.com Date: Tue, 22 Jan 2008 13:11:43 +0100 (CET) Message-ID: <1019eb6b77e0a78e430104592107169a@www2.mail.volny.cz> X-Mailer: Volny.cz Webmail2 2.92 X-Originating-Ip: 89.24.26.56 X-Originating-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070730 SUSE/2.0.0.6-25 Firefox/2.0.0.6 X-Webmail2-Origin: vtech/volny.cz [89.24.26.56] X-Priority: 3 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Barracuda-Connect: smtp3.vol.cz[195.250.128.83] X-Barracuda-Start-Time: 1201003937 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/5519/Mon Jan 21 20:46:17 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14249 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: vtech@volny.cz Precedence: bulk X-list: xfs Hi, I have LVM2 logical volume built of 6 harddrives (total capacity 1.3TB). There is a single XFS filesystem on top of it. The 1st drive (ie. pv0) died, so I'm missing the XFS filesystem headers. What are my chances to rescue the data from drives, which are OK? (Over 80% of data). What should I do/try? Thank You, Vit Kavan PS.: Yes, I know, it's a stupid design. I'll never do it again, I promise :) From owner-xfs@oss.sgi.com Tue Jan 22 11:46:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jan 2008 11:46:58 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0MJkTJ5005676 for ; Tue, 22 Jan 2008 11:46:30 -0800 X-ASG-Debug-ID: 1201031206-0d78005a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.purevideo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 93CFCCC6DDF for ; Tue, 22 Jan 2008 11:46:46 -0800 (PST) Received: from mail.purevideo.com (mail.purevideo.com [208.50.29.149]) by cuda.sgi.com with ESMTP id VaeuUN2Hanmj9pxq for ; Tue, 22 Jan 2008 11:46:46 -0800 (PST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-ASG-Orig-Subj: RE: Repairing a possibly incomplete xfs_growfs command? Subject: RE: Repairing a possibly incomplete xfs_growfs command? Date: Tue, 22 Jan 2008 11:40:52 -0800 Message-ID: <9CE70E6ED2C2F64FB5537A2973FA4F0253596D@pvn-3001.purevideo.local> In-Reply-To: <20080119004018.GH155407@sgi.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Repairing a possibly incomplete xfs_growfs command? Thread-Index: AchaNCxDd0cWHfRuRrOq7JsbXPZzfQC+4Dmg References: <9CE70E6ED2C2F64FB5537A2973FA4F0253595A@pvn-3001.purevideo.local> <20080117234604.GG155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253595B@pvn-3001.purevideo.local> <20080119004018.GH155407@sgi.com> From: "Mark Magpayo" To: "David Chinner" Cc: X-Barracuda-Connect: mail.purevideo.com[208.50.29.149] X-Barracuda-Start-Time: 1201031209 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40199 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5521/Tue Jan 22 06:55:56 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m0MJkUJ5005679 X-archive-position: 14250 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: mmagpayo@purevideo.com Precedence: bulk X-list: xfs > -----Original Message----- > From: David Chinner [mailto:dgc@sgi.com] > Sent: Friday, January 18, 2008 4:40 PM > To: Mark Magpayo > Cc: David Chinner; xfs@oss.sgi.com > Subject: Re: Repairing a possibly incomplete xfs_growfs command? > > On Fri, Jan 18, 2008 at 09:50:37AM -0800, Mark Magpayo wrote: > > > > So is this all I need then prior to an xfs_repair?: > > > > > > > > > # for i in `seq 0 1 63`; do > > > > > > xfs_db -x -c "sb $i" -c 'write agcount 64' -c 'write dblock > > > 4761733120' > > > > > /dev/vg0/lv0 > > > > > > Yes, I think that is all that is necessary (that+repair was what fixed > > > the problem at the customer site successfully). > > > > > > > Is this supposed to be the proper output to the command above? > > > > purenas:~# for i in `seq 0 1 63`; do xfs_db -x -c "sb $i" -c 'write > > agcount 64' -c 'write dblock 4761733120' /dev/vg0/lv0; done > > agcount = 64 > > field dblock not found > > parsing error > > Ah - As eric pointed out, that should be "dblocks". > > Cheers, > > Dave. > -- > Dave Chinner > Principal Engineer > SGI Australian Software Group Any ideas on how long the xfs_repair is supposed to take on 18TB? I started it Friday nite, and it's now Tuesday afternoon. It's stuck here: Phase 5 - rebuild AG headers and trees... - reset superblock... Phase 6 - check inode connectivity... - resetting contents of realtime bitmap and summary inodes - traversing filesystem ... I figure traversing a filesystem of 18TB takes a while, but does 4 days sound right? Thanks, Mark From owner-xfs@oss.sgi.com Tue Jan 22 12:00:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jan 2008 12:00:29 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0MK0K2n009315 for ; Tue, 22 Jan 2008 12:00:25 -0800 X-ASG-Debug-ID: 1201032040-0d3100870000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ishtar.tlinx.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B0CBACC70EA for ; Tue, 22 Jan 2008 12:00:40 -0800 (PST) Received: from ishtar.tlinx.org (ishtar.tlinx.org [64.81.245.74]) by cuda.sgi.com with ESMTP id gjBABjg3s9H4tILo for ; Tue, 22 Jan 2008 12:00:40 -0800 (PST) Received: from [192.168.3.11] (Athena [192.168.3.11]) by ishtar.tlinx.org (8.13.3/8.12.10/SuSE Linux 0.7) with ESMTP id m0MK0cE3006881; Tue, 22 Jan 2008 12:00:38 -0800 Message-ID: <47964B66.5020001@tlinx.org> Date: Tue, 22 Jan 2008 12:00:38 -0800 From: Linda Walsh User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Jan Blunck CC: linux-btrace@vger.kernel.org, Linux-Xfs X-ASG-Orig-Subj: Re: blktrace & btrace usability Subject: Re: blktrace & btrace usability References: <47906577.8090604@tlinx.org> <20080122164145.GB4531@hasse.suse.de> In-Reply-To: <20080122164145.GB4531@hasse.suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: ishtar.tlinx.org[64.81.245.74] X-Barracuda-Start-Time: 1201032040 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40199 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5521/Tue Jan 22 06:55:56 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14251 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lkml@tlinx.org Precedence: bulk X-list: xfs Jan Blunck wrote: > blktrace is used by the preload package. The preload package is capable of > remapping blocks for faster booting. Therefore we need the blktrace > output. But we only have a remapper for ext3. > ---- I wondered about that, but the blktrace package doesn't containg any utility for remapping blocks. The blktrace-0.99.3-12 package included in OSuse-10.3, I only see utilities "blkparse, blktrace, btrace, blkrawverify, btt, and verify_blktrace". Was it left out by accident? ---or--- If the remapping is in a separate package, then shouldn't the blktrace package "just" do the block tracing, regardless of file type (i.e. in typical unix fashion, it does its part, and another util (a block-re-arranger) does its part...? Having blktrace do it's thing no matter what filesystem follows might encourage or enable someone to write re-arrangers for other filesystems...(?) After all, xfs already has one block-rearranger program (for what little it is needed) in "xfs_fsr". Does ext3 have something similar now? Was the ext3 block re-arranging tool supposed to be in the blktrace package? thanks, linda From owner-xfs@oss.sgi.com Tue Jan 22 13:13:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jan 2008 13:13:05 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0MLCwQq031716 for ; Tue, 22 Jan 2008 13:13:01 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id IAA20425; Wed, 23 Jan 2008 08:13:14 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0MLDCLF35565683; Wed, 23 Jan 2008 08:13:13 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0MLDBDj35554747; Wed, 23 Jan 2008 08:13:11 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Wed, 23 Jan 2008 08:13:11 +1100 From: David Chinner To: Mark Magpayo Cc: xfs@oss.sgi.com Subject: Re: Repairing a possibly incomplete xfs_growfs command? Message-ID: <20080122211311.GA155259@sgi.com> References: <9CE70E6ED2C2F64FB5537A2973FA4F0253595A@pvn-3001.purevideo.local> <20080117234604.GG155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253595B@pvn-3001.purevideo.local> <20080119004018.GH155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253596D@pvn-3001.purevideo.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9CE70E6ED2C2F64FB5537A2973FA4F0253596D@pvn-3001.purevideo.local> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5521/Tue Jan 22 06:55:56 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14252 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Tue, Jan 22, 2008 at 11:40:52AM -0800, Mark Magpayo wrote: > Any ideas on how long the xfs_repair is supposed to take on 18TB? I > started it Friday nite, and it's now Tuesday afternoon. It's stuck > here: > > Phase 5 - rebuild AG headers and trees... > - reset superblock... > Phase 6 - check inode connectivity... > - resetting contents of realtime bitmap and summary inodes > - traversing filesystem ... > > I figure traversing a filesystem of 18TB takes a while, but does 4 days > sound right? Yes, it can if it's swapping like mad because you don't have enough RAM in the machine. Runtime is also detemrined by how many inodes there are in the filesystem - do you know how many there are? Also, more recent xfs_repair versions tend to be faster - what version are you using again? Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Tue Jan 22 13:52:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jan 2008 13:52:37 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0MLqUIF001351 for ; Tue, 22 Jan 2008 13:52:33 -0800 X-ASG-Debug-ID: 1201038766-5e6100df0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.purevideo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D5B65CC8451 for ; Tue, 22 Jan 2008 13:52:46 -0800 (PST) Received: from mail.purevideo.com (mail.purevideo.com [208.50.29.149]) by cuda.sgi.com with ESMTP id jloJReMGNVH7SWus for ; Tue, 22 Jan 2008 13:52:46 -0800 (PST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-ASG-Orig-Subj: RE: Repairing a possibly incomplete xfs_growfs command? Subject: RE: Repairing a possibly incomplete xfs_growfs command? Date: Tue, 22 Jan 2008 13:46:56 -0800 Message-ID: <9CE70E6ED2C2F64FB5537A2973FA4F0253596F@pvn-3001.purevideo.local> In-Reply-To: <20080122211311.GA155259@sgi.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Repairing a possibly incomplete xfs_growfs command? Thread-Index: AchdOui+NcBNbiFhSNK9Vxj0jAlePQABmU2g References: <9CE70E6ED2C2F64FB5537A2973FA4F0253595A@pvn-3001.purevideo.local> <20080117234604.GG155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253595B@pvn-3001.purevideo.local> <20080119004018.GH155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253596D@pvn-3001.purevideo.local> <20080122211311.GA155259@sgi.com> From: "Mark Magpayo" To: "David Chinner" Cc: X-Barracuda-Connect: mail.purevideo.com[208.50.29.149] X-Barracuda-Start-Time: 1201038770 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40207 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5523/Tue Jan 22 11:31:19 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m0MLqYIF001355 X-archive-position: 14253 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: mmagpayo@purevideo.com Precedence: bulk X-list: xfs > -----Original Message----- > From: xfs-bounce@oss.sgi.com [mailto:xfs-bounce@oss.sgi.com] On Behalf Of > David Chinner > Sent: Tuesday, January 22, 2008 1:13 PM > To: Mark Magpayo > Cc: xfs@oss.sgi.com > Subject: Re: Repairing a possibly incomplete xfs_growfs command? > > On Tue, Jan 22, 2008 at 11:40:52AM -0800, Mark Magpayo wrote: > > Any ideas on how long the xfs_repair is supposed to take on 18TB? I > > started it Friday nite, and it's now Tuesday afternoon. It's stuck > > here: > > > > Phase 5 - rebuild AG headers and trees... > > - reset superblock... > > Phase 6 - check inode connectivity... > > - resetting contents of realtime bitmap and summary inodes > > - traversing filesystem ... > > > > I figure traversing a filesystem of 18TB takes a while, but does 4 days > > sound right? > > Yes, it can if it's swapping like mad because you don't have enough > RAM in the machine. Runtime is also detemrined by how many inodes there > are in the filesystem - do you know how many there are? Also, more > recent xfs_repair versions tend to be faster - what version are you > using again? Using version 2.9.4. I may have forgotten to allocate more swap space (as was told in the manual given to me by the vendor), so would breaking out of the repair and restarting with more swap help out, or am I too deep (4 days) into it and should just let it run? -Mark From owner-xfs@oss.sgi.com Tue Jan 22 14:48:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jan 2008 14:48:21 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0MMmCpH011555 for ; Tue, 22 Jan 2008 14:48:16 -0800 Received: from [134.14.55.21] (dhcp21.melbourne.sgi.com [134.14.55.21]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id JAA23146; Wed, 23 Jan 2008 09:48:25 +1100 Message-ID: <479672B2.9070103@sgi.com> Date: Wed, 23 Jan 2008 09:48:18 +1100 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 1.5.0.14 (Windows/20071210) MIME-Version: 1.0 To: Mark Magpayo CC: David Chinner , xfs@oss.sgi.com Subject: Re: Repairing a possibly incomplete xfs_growfs command? References: <9CE70E6ED2C2F64FB5537A2973FA4F0253595A@pvn-3001.purevideo.local> <20080117234604.GG155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253595B@pvn-3001.purevideo.local> <20080119004018.GH155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253596D@pvn-3001.purevideo.local> <20080122211311.GA155259@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253596F@pvn-3001.purevideo.local> In-Reply-To: <9CE70E6ED2C2F64FB5537A2973FA4F0253596F@pvn-3001.purevideo.local> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/5523/Tue Jan 22 11:31:19 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14254 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Mark Magpayo wrote: >> -----Original Message----- >> From: xfs-bounce@oss.sgi.com [mailto:xfs-bounce@oss.sgi.com] On Behalf > Of >> David Chinner >> Sent: Tuesday, January 22, 2008 1:13 PM >> To: Mark Magpayo >> Cc: xfs@oss.sgi.com >> Subject: Re: Repairing a possibly incomplete xfs_growfs command? >> >> On Tue, Jan 22, 2008 at 11:40:52AM -0800, Mark Magpayo wrote: >>> Any ideas on how long the xfs_repair is supposed to take on 18TB? I >>> started it Friday nite, and it's now Tuesday afternoon. It's stuck >>> here: >>> >>> Phase 5 - rebuild AG headers and trees... >>> - reset superblock... >>> Phase 6 - check inode connectivity... >>> - resetting contents of realtime bitmap and summary inodes >>> - traversing filesystem ... >>> >>> I figure traversing a filesystem of 18TB takes a while, but does 4 > days >>> sound right? >> Yes, it can if it's swapping like mad because you don't have enough >> RAM in the machine. Runtime is also detemrined by how many inodes > there >> are in the filesystem - do you know how many there are? Also, more >> recent xfs_repair versions tend to be faster - what version are you >> using again? > > Using version 2.9.4. I may have forgotten to allocate more swap space > (as was told in the manual given to me by the vendor), so would breaking > out of the repair and restarting with more swap help out, or am I too > deep (4 days) into it and should just let it run? cat /proc/meminfo for this machine and post it here. If it's swapping, adding more swap wont speed it up. If it runs out of swap the repair will stop anyway ;-) Cheers -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Tue Jan 22 14:55:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jan 2008 14:55:48 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0MMtcrt013085 for ; Tue, 22 Jan 2008 14:55:44 -0800 X-ASG-Debug-ID: 1201042558-11af00ed0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.purevideo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3B3DFCCCADF for ; Tue, 22 Jan 2008 14:55:58 -0800 (PST) Received: from mail.purevideo.com (mail.purevideo.com [208.50.29.149]) by cuda.sgi.com with ESMTP id 91SJXUzkq3DmRGsY for ; Tue, 22 Jan 2008 14:55:58 -0800 (PST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-ASG-Orig-Subj: RE: Repairing a possibly incomplete xfs_growfs command? Subject: RE: Repairing a possibly incomplete xfs_growfs command? Date: Tue, 22 Jan 2008 14:50:39 -0800 Message-ID: <9CE70E6ED2C2F64FB5537A2973FA4F02535970@pvn-3001.purevideo.local> In-Reply-To: <479672B2.9070103@sgi.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Repairing a possibly incomplete xfs_growfs command? Thread-Index: AchdSD2d5cUp4xEwRL2aJxhU6AzCrwAAc4Kw References: <9CE70E6ED2C2F64FB5537A2973FA4F0253595A@pvn-3001.purevideo.local> <20080117234604.GG155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253595B@pvn-3001.purevideo.local> <20080119004018.GH155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253596D@pvn-3001.purevideo.local> <20080122211311.GA155259@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253596F@pvn-3001.purevideo.local> <479672B2.9070103@sgi.com> From: "Mark Magpayo" To: Cc: "David Chinner" , X-Barracuda-Connect: mail.purevideo.com[208.50.29.149] X-Barracuda-Start-Time: 1201042558 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40211 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5523/Tue Jan 22 11:31:19 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m0MMtirt013096 X-archive-position: 14255 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: mmagpayo@purevideo.com Precedence: bulk X-list: xfs > -----Original Message----- > From: xfs-bounce@oss.sgi.com [mailto:xfs-bounce@oss.sgi.com] On Behalf Of > Mark Goodwin > Sent: Tuesday, January 22, 2008 2:48 PM > To: Mark Magpayo > Cc: David Chinner; xfs@oss.sgi.com > Subject: Re: Repairing a possibly incomplete xfs_growfs command? > > > > Mark Magpayo wrote: > >> -----Original Message----- > >> From: xfs-bounce@oss.sgi.com [mailto:xfs-bounce@oss.sgi.com] On Behalf > > Of > >> David Chinner > >> Sent: Tuesday, January 22, 2008 1:13 PM > >> To: Mark Magpayo > >> Cc: xfs@oss.sgi.com > >> Subject: Re: Repairing a possibly incomplete xfs_growfs command? > >> > >> On Tue, Jan 22, 2008 at 11:40:52AM -0800, Mark Magpayo wrote: > >>> Any ideas on how long the xfs_repair is supposed to take on 18TB? I > >>> started it Friday nite, and it's now Tuesday afternoon. It's stuck > >>> here: > >>> > >>> Phase 5 - rebuild AG headers and trees... > >>> - reset superblock... > >>> Phase 6 - check inode connectivity... > >>> - resetting contents of realtime bitmap and summary inodes > >>> - traversing filesystem ... > >>> > >>> I figure traversing a filesystem of 18TB takes a while, but does 4 > > days > >>> sound right? > >> Yes, it can if it's swapping like mad because you don't have enough > >> RAM in the machine. Runtime is also detemrined by how many inodes > > there > >> are in the filesystem - do you know how many there are? Also, more > >> recent xfs_repair versions tend to be faster - what version are you > >> using again? > > > > Using version 2.9.4. I may have forgotten to allocate more swap space > > (as was told in the manual given to me by the vendor), so would breaking > > out of the repair and restarting with more swap help out, or am I too > > deep (4 days) into it and should just let it run? > > cat /proc/meminfo for this machine and post it here. If it's swapping, > adding more swap wont speed it up. If it runs out of swap the repair > will stop anyway ;-) Here you go: purenas:~# cat /proc/meminfo MemTotal: 1019732 kB MemFree: 580920 kB Buffers: 1720 kB Cached: 17912 kB SwapCached: 21712 kB Active: 44016 kB Inactive: 8488 kB HighTotal: 0 kB HighFree: 0 kB LowTotal: 1019732 kB LowFree: 580920 kB SwapTotal: 732574516 kB SwapFree: 732548180 kB Dirty: 12 kB Writeback: 0 kB Mapped: 36096 kB Slab: 18016 kB CommitLimit: 732778460 kB Committed_AS: 55612 kB PageTables: 1420 kB VmallocTotal: 34359738367 kB VmallocUsed: 358616 kB VmallocChunk: 34359379631 kB Nevermind my previous comment about turning on swap, looks like I had it turned on afterall. Any reason to think it may have stopped? Or does it just take that long to run? Thanks, Mark From owner-xfs@oss.sgi.com Tue Jan 22 15:01:32 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jan 2008 15:01:35 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.8 required=5.0 tests=AWL,BAYES_50,RCVD_NUMERIC_HELO autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0MN1VAI014375 for ; Tue, 22 Jan 2008 15:01:32 -0800 X-ASG-Debug-ID: 1201042910-76b901e80000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail47.messagelabs.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 51EAD54B272 for ; Tue, 22 Jan 2008 15:01:50 -0800 (PST) Received: from mail47.messagelabs.com (mail47.messagelabs.com [216.82.240.163]) by cuda.sgi.com with SMTP id 1XNYhCpIdA0Ciw5Z for ; Tue, 22 Jan 2008 15:01:50 -0800 (PST) X-VirusChecked: Checked X-Env-Sender: salmr0@bp.com X-Msg-Ref: server-14.tower-47.messagelabs.com!1201042906!37478421!1 X-StarScan-Version: 5.5.12.14.2; banners=-,-,- X-Originating-IP: [129.230.248.73] Received: (qmail 7684 invoked from network); 22 Jan 2008 23:01:46 -0000 Received: from unknown (HELO bp1xeuav706.bp1.ad.bp.com) (129.230.248.73) by server-14.tower-47.messagelabs.com with SMTP; 22 Jan 2008 23:01:46 -0000 Received: from BP1XEUEX032.bp1.ad.bp.com ([149.184.176.166]) by bp1xeuav706.bp1.ad.bp.com with InterScan Messaging Security Suite; Tue, 22 Jan 2008 23:01:25 -0000 Received: from bp1xeuex007.bp1.ad.bp.com ([149.184.176.243]) by BP1XEUEX032.bp1.ad.bp.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 22 Jan 2008 23:01:24 +0000 Received: from BP1XEUEX706-C.bp1.ad.bp.com ([149.182.218.110]) by bp1xeuex007.bp1.ad.bp.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 22 Jan 2008 23:01:23 +0000 Received: from 149.179.228.36 ([149.179.228.36]) by BP1XEUEX706-C.bp1.ad.bp.com ([149.182.218.28]) with Microsoft Exchange Server HTTP-DAV ; Tue, 22 Jan 2008 23:01:22 +0000 Received: from holwrs01 by BP1XEUEX706-C.bp1.ad.bp.com; 22 Jan 2008 17:01:22 -0600 X-ASG-Orig-Subj: xfs_rapair memory requirement per TB Subject: xfs_rapair memory requirement per TB From: Rene Salmon To: xfs@oss.sgi.com Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Tue, 22 Jan 2008 17:01:22 -0600 Message-Id: <1201042882.32649.256.camel@holwrs01.bp.com> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 X-OriginalArrivalTime: 22 Jan 2008 23:01:23.0208 (UTC) FILETIME=[B5616080:01C85D4A] X-Barracuda-Connect: mail47.messagelabs.com[216.82.240.163] X-Barracuda-Start-Time: 1201042911 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.77 X-Barracuda-Spam-Status: No, SCORE=-0.77 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=RCVD_NUMERIC_HELO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40212 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.25 RCVD_NUMERIC_HELO Received: contains an IP address used for HELO 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-Virus-Scanned: ClamAV 0.91.2/5523/Tue Jan 22 11:31:19 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14256 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: salmr0@bp.com Precedence: bulk X-list: xfs Hi, Reading the "Repairing a possibly incomplete xfs_growfs command?" thread this month makes me wonder if there is some type of rough formula or guesstimation cheat sheet to figure out how much memory and swap one would need for an xfs_repair given a file system with many terabytes. Say I have an 8TB LUN that needs an xfs_repair. What would be the rough memory requirements and swap space? Thanks Rene From owner-xfs@oss.sgi.com Tue Jan 22 18:26:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jan 2008 18:26:47 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0N2QRqc008415 for ; Tue, 22 Jan 2008 18:26:37 -0800 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA00690; Wed, 23 Jan 2008 13:26:43 +1100 Received: by chook.melbourne.sgi.com (Postfix, from userid 1161) id 41F5558C4C10; Wed, 23 Jan 2008 13:26:43 +1100 (EST) To: sgi.bugs.xfs@engr.sgi.com Cc: xfs@oss.sgi.com Subject: TAKE 907752 - Fix minor problems with attr man pages Message-Id: <20080123022643.41F5558C4C10@chook.melbourne.sgi.com> Date: Wed, 23 Jan 2008 13:26:43 +1100 (EST) From: bnaujok@sgi.com (Barry Naujok) X-Virus-Scanned: ClamAV 0.91.2/5526/Tue Jan 22 14:51:13 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14257 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Date: Wed Jan 23 13:25:47 AEDT 2008 Workarea: chook.melbourne.sgi.com:/home/bnaujok/isms/xfs-cmds Inspected by: rrt@sc3d.org The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:30415a attr/man/man3/attr_set.3 - 1.9 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/attr/man/man3/attr_set.3.diff?r1=text&tr1=1.9&r2=text&tr2=1.8&f=h attr/man/man3/attr_get.3 - 1.9 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/attr/man/man3/attr_get.3.diff?r1=text&tr1=1.9&r2=text&tr2=1.8&f=h - Remove extra ' attr/man/man2/listxattr.2 - 1.7 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/attr/man/man2/listxattr.2.diff?r1=text&tr1=1.7&r2=text&tr2=1.6&f=h - Improve description for list argument From owner-xfs@oss.sgi.com Tue Jan 22 18:50:40 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jan 2008 18:50:45 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0N2oZQj009704 for ; Tue, 22 Jan 2008 18:50:39 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA01271; Wed, 23 Jan 2008 13:50:48 +1100 Date: Wed, 23 Jan 2008 13:51:41 +1100 To: "Rene Salmon" , xfs@oss.sgi.com Subject: Re: xfs_rapair memory requirement per TB From: "Barry Naujok" Organization: SGI Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <1201042882.32649.256.camel@holwrs01.bp.com> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <1201042882.32649.256.camel@holwrs01.bp.com> User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5526/Tue Jan 22 14:51:13 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14258 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Wed, 23 Jan 2008 10:01:22 +1100, Rene Salmon wrote: > Hi, > > Reading the "Repairing a possibly incomplete xfs_growfs command?" thread > this month makes me wonder if there is some type of rough formula or > guesstimation cheat sheet to figure out how much memory and swap one > would need for an xfs_repair given a file system with many terabytes. > > > Say I have an 8TB LUN that needs an xfs_repair. What would be the rough > memory requirements and swap space? > General rule of thumb at the moment is 128MB of RAM/TB of filesystem plus 4MB/million inodes on that filesystem. Barry. From owner-xfs@oss.sgi.com Tue Jan 22 18:56:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jan 2008 18:56:35 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0N2uRfb010311 for ; Tue, 22 Jan 2008 18:56:30 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA01368; Wed, 23 Jan 2008 13:56:43 +1100 Date: Wed, 23 Jan 2008 13:57:37 +1100 To: "Mark Magpayo" Subject: Re: Repairing a possibly incomplete xfs_growfs command? From: "Barry Naujok" Organization: SGI Cc: xfs@oss.sgi.com Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <9CE70E6ED2C2F64FB5537A2973FA4F0253595A@pvn-3001.purevideo.local> <20080117234604.GG155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253595B@pvn-3001.purevideo.local> <20080119004018.GH155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253596D@pvn-3001.purevideo.local> Message-ID: In-Reply-To: <9CE70E6ED2C2F64FB5537A2973FA4F0253596D@pvn-3001.purevideo.local> User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5526/Tue Jan 22 14:51:13 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from Quoted-Printable to 8bit by oss.sgi.com id m0N2uVfb010315 X-archive-position: 14259 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Wed, 23 Jan 2008 06:40:52 +1100, Mark Magpayo wrote: > >> -----Original Message----- >> From: David Chinner [mailto:dgc@sgi.com] >> Sent: Friday, January 18, 2008 4:40 PM >> To: Mark Magpayo >> Cc: David Chinner; xfs@oss.sgi.com >> Subject: Re: Repairing a possibly incomplete xfs_growfs command? >> >> On Fri, Jan 18, 2008 at 09:50:37AM -0800, Mark Magpayo wrote: >> > > > So is this all I need then prior to an xfs_repair?: >> > > > >> > > > > # for i in `seq 0 1 63`; do >> > > > > > xfs_db -x -c "sb $i" -c 'write agcount 64' -c 'write dblock >> > > 4761733120' >> > > > > /dev/vg0/lv0 >> > > >> > > Yes, I think that is all that is necessary (that+repair was what > fixed >> > > the problem at the customer site successfully). >> > > >> > >> > Is this supposed to be the proper output to the command above? >> > >> > purenas:~# for i in `seq 0 1 63`; do xfs_db -x -c "sb $i" -c 'write >> > agcount 64' -c 'write dblock 4761733120' /dev/vg0/lv0; done >> > agcount = 64 >> > field dblock not found >> > parsing error >> >> Ah - As eric pointed out, that should be "dblocks". >> >> Cheers, >> >> Dave. >> -- >> Dave Chinner >> Principal Engineer >> SGI Australian Software Group > > Any ideas on how long the xfs_repair is supposed to take on 18TB? I > started it Friday nite, and it's now Tuesday afternoon. It's stuck > here: > > Phase 5 - rebuild AG headers and trees... > - reset superblock... > Phase 6 - check inode connectivity... > - resetting contents of realtime bitmap and summary inodes > - traversing filesystem ... > > I figure traversing a filesystem of 18TB takes a while, but does 4 days > sound right? Was it stuck on Phase 6 all that time? With only 1GB of RAM (from your meminfo output) and 18TB filesystem, Phases 3 and 4 will take a very long time due to swapping. Phase 6 in your scenario should be relatively quick and light on memory usage (500MB as reported in your other email). It is feasible it is deadlocked by trying to double-access a buffer, or access a buffer that wasn't released. This is an unlikely scenario, but it is possible. Regards, Barry. From owner-xfs@oss.sgi.com Tue Jan 22 21:12:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jan 2008 21:12:56 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0N5ChlJ010393 for ; Tue, 22 Jan 2008 21:12:47 -0800 Received: from timothy-shimmins-power-mac-g5.local (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA04079; Wed, 23 Jan 2008 16:12:55 +1100 Message-ID: <4796CCF5.8010509@sgi.com> Date: Wed, 23 Jan 2008 16:13:25 +1100 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: David Chinner CC: xfs-dev , xfs-oss Subject: Re: [patch] Use atomics for iclog reference counting References: <20080121053021.GH155259@sgi.com> In-Reply-To: <20080121053021.GH155259@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV 0.91.2/5526/Tue Jan 22 14:51:13 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14260 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs I'll have a look... --Tim David Chinner wrote: > Now that we update the log tail LSN less frequently on > transaction completion, we pass the contention straight to > the global block stat lock (l_iclog_lock) during transaction > completion. > > We currently have to take this lock to decrement the iclog > reference count. there is a reference count on each iclog, > so we need to take þhe global lock for all refcount changes. > > When large numbers of processes are all doing small trnasctions, > the iclog reference counts will be quite high, and the state change > that absolutely requires the l_iclog_lock is the except rather than > the norm. > > Change the reference counting on the iclogs to use atomic_inc/dec > so that we can use atomic_dec_and_lock during transaction completion > and avoid the need for grabbing the l_iclog_lock for every reference > count decrement except the one that matters - the last. > > Signed-off-by: Dave Chinner > --- > fs/xfs/xfs_log.c | 36 +++++++++++++++++++++--------------- > fs/xfs/xfs_log_priv.h | 2 +- > fs/xfs/xfsidbg.c | 2 +- > 3 files changed, 23 insertions(+), 17 deletions(-) > > Index: 2.6.x-xfs-new/fs/xfs/xfs_log.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/xfs_log.c 2008-01-21 16:16:51.804146394 +1100 > +++ 2.6.x-xfs-new/fs/xfs/xfs_log.c 2008-01-21 16:23:35.369691221 +1100 > @@ -675,7 +675,7 @@ xfs_log_unmount_write(xfs_mount_t *mp) > > spin_lock(&log->l_icloglock); > iclog = log->l_iclog; > - iclog->ic_refcnt++; > + atomic_inc(&iclog->ic_refcnt); > spin_unlock(&log->l_icloglock); > xlog_state_want_sync(log, iclog); > (void) xlog_state_release_iclog(log, iclog); > @@ -713,7 +713,7 @@ xfs_log_unmount_write(xfs_mount_t *mp) > */ > spin_lock(&log->l_icloglock); > iclog = log->l_iclog; > - iclog->ic_refcnt++; > + atomic_inc(&iclog->ic_refcnt); > spin_unlock(&log->l_icloglock); > > xlog_state_want_sync(log, iclog); > @@ -1405,7 +1405,7 @@ xlog_sync(xlog_t *log, > int v2 = XFS_SB_VERSION_HASLOGV2(&log->l_mp->m_sb); > > XFS_STATS_INC(xs_log_writes); > - ASSERT(iclog->ic_refcnt == 0); > + ASSERT(atomic_read(&iclog->ic_refcnt) == 0); > > /* Add for LR header */ > count_init = log->l_iclog_hsize + iclog->ic_offset; > @@ -2311,7 +2311,7 @@ xlog_state_done_syncing( > > ASSERT(iclog->ic_state == XLOG_STATE_SYNCING || > iclog->ic_state == XLOG_STATE_IOERROR); > - ASSERT(iclog->ic_refcnt == 0); > + ASSERT(atomic_read(&iclog->ic_refcnt) == 0); > ASSERT(iclog->ic_bwritecnt == 1 || iclog->ic_bwritecnt == 2); > > > @@ -2393,7 +2393,7 @@ restart: > ASSERT(iclog->ic_state == XLOG_STATE_ACTIVE); > head = &iclog->ic_header; > > - iclog->ic_refcnt++; /* prevents sync */ > + atomic_inc(&iclog->ic_refcnt); /* prevents sync */ > log_offset = iclog->ic_offset; > > /* On the 1st write to an iclog, figure out lsn. This works > @@ -2425,12 +2425,12 @@ restart: > xlog_state_switch_iclogs(log, iclog, iclog->ic_size); > > /* If I'm the only one writing to this iclog, sync it to disk */ > - if (iclog->ic_refcnt == 1) { > + if (atomic_read(&iclog->ic_refcnt) == 1) { > spin_unlock(&log->l_icloglock); > if ((error = xlog_state_release_iclog(log, iclog))) > return error; > } else { > - iclog->ic_refcnt--; > + atomic_dec(&iclog->ic_refcnt); > spin_unlock(&log->l_icloglock); > } > goto restart; > @@ -2821,18 +2821,23 @@ xlog_state_release_iclog( > { > int sync = 0; /* do we sync? */ > > - spin_lock(&log->l_icloglock); > if (iclog->ic_state & XLOG_STATE_IOERROR) { > spin_unlock(&log->l_icloglock); > return XFS_ERROR(EIO); > } > > - ASSERT(iclog->ic_refcnt > 0); > + ASSERT(atomic_read(&iclog->ic_refcnt) > 0); > + if (!atomic_dec_and_lock(&iclog->ic_refcnt, &log->l_icloglock)) > + return 0; > + > + if (iclog->ic_state & XLOG_STATE_IOERROR) { > + spin_unlock(&log->l_icloglock); > + return XFS_ERROR(EIO); > + } > ASSERT(iclog->ic_state == XLOG_STATE_ACTIVE || > iclog->ic_state == XLOG_STATE_WANT_SYNC); > > - if (--iclog->ic_refcnt == 0 && > - iclog->ic_state == XLOG_STATE_WANT_SYNC) { > + if (iclog->ic_state == XLOG_STATE_WANT_SYNC) { > /* update tail before writing to iclog */ > xlog_assign_tail_lsn(log->l_mp); > sync++; > @@ -2952,7 +2957,8 @@ xlog_state_sync_all(xlog_t *log, uint fl > * previous iclog and go to sleep. > */ > if (iclog->ic_state == XLOG_STATE_DIRTY || > - (iclog->ic_refcnt == 0 && iclog->ic_offset == 0)) { > + (atomic_read(&iclog->ic_refcnt) == 0 > + && iclog->ic_offset == 0)) { > iclog = iclog->ic_prev; > if (iclog->ic_state == XLOG_STATE_ACTIVE || > iclog->ic_state == XLOG_STATE_DIRTY) > @@ -2960,14 +2966,14 @@ xlog_state_sync_all(xlog_t *log, uint fl > else > goto maybe_sleep; > } else { > - if (iclog->ic_refcnt == 0) { > + if (atomic_read(&iclog->ic_refcnt) == 0) { > /* We are the only one with access to this > * iclog. Flush it out now. There should > * be a roundoff of zero to show that someone > * has already taken care of the roundoff from > * the previous sync. > */ > - iclog->ic_refcnt++; > + atomic_inc(&iclog->ic_refcnt); > lsn = be64_to_cpu(iclog->ic_header.h_lsn); > xlog_state_switch_iclogs(log, iclog, 0); > spin_unlock(&log->l_icloglock); > @@ -3099,7 +3105,7 @@ try_again: > already_slept = 1; > goto try_again; > } else { > - iclog->ic_refcnt++; > + atomic_inc(&iclog->ic_refcnt); > xlog_state_switch_iclogs(log, iclog, 0); > spin_unlock(&log->l_icloglock); > if (xlog_state_release_iclog(log, iclog)) > Index: 2.6.x-xfs-new/fs/xfs/xfs_log_priv.h > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/xfs_log_priv.h 2008-01-21 16:06:27.127557437 +1100 > +++ 2.6.x-xfs-new/fs/xfs/xfs_log_priv.h 2008-01-21 16:23:35.369691221 +1100 > @@ -339,7 +339,7 @@ typedef struct xlog_iclog_fields { > #endif > int ic_size; > int ic_offset; > - int ic_refcnt; > + atomic_t ic_refcnt; > int ic_bwritecnt; > ushort_t ic_state; > char *ic_datap; /* pointer to iclog data */ > Index: 2.6.x-xfs-new/fs/xfs/xfsidbg.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/xfsidbg.c 2008-01-21 16:06:27.127557437 +1100 > +++ 2.6.x-xfs-new/fs/xfs/xfsidbg.c 2008-01-21 16:23:35.385689220 +1100 > @@ -5633,7 +5633,7 @@ xfsidbg_xiclog(xlog_in_core_t *iclog) > #else > NULL, > #endif > - iclog->ic_refcnt, iclog->ic_bwritecnt); > + atomic_read(&iclog->ic_refcnt), iclog->ic_bwritecnt); > if (iclog->ic_state & XLOG_STATE_ALL) > printflags(iclog->ic_state, ic_flags, " state:"); > else From owner-xfs@oss.sgi.com Tue Jan 22 22:55:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jan 2008 22:55:12 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0N6t5id017290 for ; Tue, 22 Jan 2008 22:55:08 -0800 X-ASG-Debug-ID: 1201071324-3c4d00050000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from pentafluge.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9445ACD1204; Tue, 22 Jan 2008 22:55:25 -0800 (PST) Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by cuda.sgi.com with ESMTP id howkqvqykJXvdNh9; Tue, 22 Jan 2008 22:55:25 -0800 (PST) Received: from hch by pentafluge.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1JHZW6-0002vk-UV; Wed, 23 Jan 2008 06:55:23 +0000 Date: Wed, 23 Jan 2008 06:55:22 +0000 From: Christoph Hellwig To: Barry Naujok Cc: Eric Sandeen , "xfs@oss.sgi.com" , xfs-dev X-ASG-Orig-Subj: Re: [REVIEW 1/2] Case insensitive support for XFS - kernel patch Subject: Re: [REVIEW 1/2] Case insensitive support for XFS - kernel patch Message-ID: <20080123065522.GA11132@infradead.org> References: <47918927.2000603@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: pentafluge.infradead.org[213.146.154.40] X-Barracuda-Start-Time: 1201071325 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.12 X-Barracuda-Spam-Status: No, SCORE=-0.12 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=BSF_SC5_MJ372, BSF_SC5_MJ398 X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40243 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.40 BSF_SC5_MJ372 Custom Rule MJ372 1.50 BSF_SC5_MJ398 Custom Rule MJ398 X-Virus-Scanned: ClamAV 0.91.2/5526/Tue Jan 22 14:51:13 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14261 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 I'm currently sick in my bed, so just a very quick glance over the patch and a few comments: - no need to export the new inode ops, they're not used by the quota or dmapi methods. - any chance you could rebase this ontop of my various vnode removals, this should make some things a little cleaner. - there's a lot of hair dcache internals in here, so please run this patch past linux-fsdevel@vger.kernel.org to get some broader review. From owner-xfs@oss.sgi.com Tue Jan 22 23:11:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jan 2008 23:11:30 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0N7BMFI018754 for ; Tue, 22 Jan 2008 23:11:24 -0800 Received: from timothy-shimmins-power-mac-g5.local (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA06392; Wed, 23 Jan 2008 18:11:38 +1100 Message-ID: <4796E8C8.3030702@sgi.com> Date: Wed, 23 Jan 2008 18:12:08 +1100 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: David Chinner CC: xfs-dev , xfs-oss Subject: Re: [patch] Prevent AIL lock contention during transaction completion References: <20080121052330.GG155259@sgi.com> In-Reply-To: <20080121052330.GG155259@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/5526/Tue Jan 22 14:51:13 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14262 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Hi Dave, So all cosmetic except for moving of xlog_assign_tail_lsn(). Looking at the code the l_tail_lsn is used by more than just when we are writing out the iclog. Certainly, that is where we set the h_tail_lsn in the iclog header, so we can find the tail later on during mount/recovery. However, we also use l_tail_lsn when trying to work out how much space is left in the log i.e. - xlog_space_left(), xlog_grant_push_tail(), xlog_grant_log_space(), xlog_regrant_write_log_space() I guess this could mean that we may fail to update the l_tail_lsn now if we don't sync the iclog (not in want-sync state etc..) and so there could be more space in the log than we realise until a bit later. Maybe not a big deal. Not sure if this really happens though or not. Looking who assigns to l_tail_lsn (apart from initialisation and recovery) we have xlog_assign_tail_lsn and xfs_log_move_tail. And (apart from recovery) xlog_assign_tail_lsn is called by our xlog_state_release_iclog. So I presume the other place where we update the l_tail_lsn in general is in calls to xfs_log_move_tail. And xfs_log_move_tail is called by: * xfs_trans_update_ail, xfs_trans_delete_ail, (xfs_trans_unlocked_item and xlog_ungrant_log_space who call xfs_log_move_tail call it with param 1 which doesn't modify l_tail_lsn) I would have thought update_ail and delete_ail would cover the changes to the ail and hence what the new min item in the ail list is and hence the change in the tail. In the case of an empty AIL, I guess it needs to use l_last_sync_lsn which is what xlog_assign_tail_lsn gives you that xfs_log_move_tail doesn't. --Tim David Chinner wrote: > When hundreds of processors attempt to commit > transactions at the same time, they can contend on the AIL > lock when updating the tail LSN held in the in-core log > structure. > > At the moment, the tail LSN is only needed when actually writing > out an iclog, so it really does not need to be updated on every > single transaction completion - only those that result in switching > iclogs and flushing them to disk. > > The result is that we reduce the number oftimes we need to grab the > AIL lock and the log grant lock by up to two orders of magnitude > on large processor count machines. The problem has previously been > hidden by AIL lock contention walking the AIL list, which has > recently been solved. > > Signed-off-by: Dave Chinner > --- > fs/xfs/xfs_log.c | 15 ++++++--------- > 1 file changed, 6 insertions(+), 9 deletions(-) > > Index: 2.6.x-xfs-new/fs/xfs/xfs_log.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/xfs_log.c 2008-01-21 16:06:27.187549816 +1100 > +++ 2.6.x-xfs-new/fs/xfs/xfs_log.c 2008-01-21 16:16:51.804146394 +1100 > @@ -2815,15 +2815,13 @@ xlog_state_put_ticket(xlog_t *log, > * > */ > STATIC int > -xlog_state_release_iclog(xlog_t *log, > - xlog_in_core_t *iclog) > +xlog_state_release_iclog( > + xlog_t *log, > + xlog_in_core_t *iclog) > { > int sync = 0; /* do we sync? */ > > - xlog_assign_tail_lsn(log->l_mp); > - > spin_lock(&log->l_icloglock); > - > if (iclog->ic_state & XLOG_STATE_IOERROR) { > spin_unlock(&log->l_icloglock); > return XFS_ERROR(EIO); > @@ -2835,13 +2833,14 @@ xlog_state_release_iclog(xlog_t *log, > > if (--iclog->ic_refcnt == 0 && > iclog->ic_state == XLOG_STATE_WANT_SYNC) { > + /* update tail before writing to iclog */ > + xlog_assign_tail_lsn(log->l_mp); > sync++; > iclog->ic_state = XLOG_STATE_SYNCING; > iclog->ic_header.h_tail_lsn = cpu_to_be64(log->l_tail_lsn); > xlog_verify_tail_lsn(log, iclog, log->l_tail_lsn); > /* cycle incremented when incrementing curr_block */ > } > - > spin_unlock(&log->l_icloglock); > > /* > @@ -2851,11 +2850,9 @@ xlog_state_release_iclog(xlog_t *log, > * this iclog has consistent data, so we ignore IOERROR > * flags after this point. > */ > - if (sync) { > + if (sync) > return xlog_sync(log, iclog); > - } > return 0; > - > } /* xlog_state_release_iclog */ > > From owner-xfs@oss.sgi.com Tue Jan 22 23:34:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jan 2008 23:34:38 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0N7YUNJ020844 for ; Tue, 22 Jan 2008 23:34:32 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA06953; Wed, 23 Jan 2008 18:34:49 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0N7YmLF35759977; Wed, 23 Jan 2008 18:34:48 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0N7YkZ735808558; Wed, 23 Jan 2008 18:34:46 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Wed, 23 Jan 2008 18:34:46 +1100 From: David Chinner To: Timothy Shimmin Cc: David Chinner , xfs-dev , xfs-oss Subject: Re: [patch] Prevent AIL lock contention during transaction completion Message-ID: <20080123073446.GU155259@sgi.com> References: <20080121052330.GG155259@sgi.com> <4796E8C8.3030702@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4796E8C8.3030702@sgi.com> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5528/Tue Jan 22 22:59:37 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14263 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Wed, Jan 23, 2008 at 06:12:08PM +1100, Timothy Shimmin wrote: > Hi Dave, > > So all cosmetic except for moving of xlog_assign_tail_lsn(). > > Looking at the code the l_tail_lsn is used by more than just > when we are writing out the iclog. > Certainly, that is where we set the h_tail_lsn in the iclog > header, so we can find the tail later on during mount/recovery. Right, but the critical usage here is to update it before it gets written into the iclog. > However, we also use l_tail_lsn when trying to work out > how much space is left in the log > i.e. > - xlog_space_left(), xlog_grant_push_tail(), > xlog_grant_log_space(), xlog_regrant_write_log_space() > > I guess this could mean that we may fail to update the l_tail_lsn > now if we don't sync the iclog (not in want-sync state etc..) > and so there could be more space > in the log than we realise until a bit later. > Maybe not a big deal. > Not sure if this really happens though or not. All correct. > > Looking who assigns to l_tail_lsn (apart from initialisation > and recovery) we have xlog_assign_tail_lsn and xfs_log_move_tail. > And (apart from recovery) xlog_assign_tail_lsn is called by our > xlog_state_release_iclog. > So I presume the other place where we update the l_tail_lsn in > general is in calls to xfs_log_move_tail. Correct. > And xfs_log_move_tail is called by: > * xfs_trans_update_ail, xfs_trans_delete_ail, > (xfs_trans_unlocked_item and xlog_ungrant_log_space who call > xfs_log_move_tail call it with param 1 which doesn't modify > l_tail_lsn) > I would have thought update_ail and delete_ail would cover the > changes to the ail and hence what the new min item in the ail list > is and hence the change in the tail. Right - the tail gets moved by (re)moving the tail object in the AIL > In the case of an empty AIL, I guess it needs to use l_last_sync_lsn > which is what xlog_assign_tail_lsn gives you that xfs_log_move_tail > doesn't. No, if a value of zero is passed to xfs_log_move_tail(), the lsn is grabbed from l_last_sync_lsn, so when we remove the last object from the AIL from xfs_trans_delete_ail() we set the l_tail_lsn to l_last_sync_lsn, same as xlog_assign_tail_lsn does. IOWs, xlog_assign_tail_lsn() could really be considered redundant as the I/O completion keeps the l_tail_lsn up to date via the AIL manipulation functions. I decided to split the difference and ensure that what is written to the iclog does not change by calling it just before the tail lsn is written into the header.... IOWs, I don't think calling xlog_assign_tail_lsn() in xlog_state_release_iclog() ever changes the l_tail_lsn because it is always kept up to date via the notifications in the AIL code..... Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Wed Jan 23 00:53:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jan 2008 00:54:18 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0N8rmVw032626 for ; Wed, 23 Jan 2008 00:53:50 -0800 X-ASG-Debug-ID: 1201078444-4bd300760000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from stlx01.stz-softwaretechnik.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6641654D59B for ; Wed, 23 Jan 2008 00:54:05 -0800 (PST) Received: from stlx01.stz-softwaretechnik.com (stz-softwaretechnik.de [217.160.223.211]) by cuda.sgi.com with ESMTP id DKCwjrRJjdduZeeF for ; Wed, 23 Jan 2008 00:54:05 -0800 (PST) Received: from rg by stlx01.stz-softwaretechnik.com with local (Exim 3.36 #1 (Debian)) id 1JHbMj-0002OW-00; Wed, 23 Jan 2008 09:53:49 +0100 Date: Wed, 23 Jan 2008 09:53:39 +0100 From: Ralf Gross To: Barry Naujok Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs_rapair memory requirement per TB Subject: Re: xfs_rapair memory requirement per TB Message-ID: <20080123085339.GB12435@p15145560.pureserver.info> References: <1201042882.32649.256.camel@holwrs01.bp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Barracuda-Connect: stz-softwaretechnik.de[217.160.223.211] X-Barracuda-Start-Time: 1201078448 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40252 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5528/Tue Jan 22 22:59:37 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14264 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Ralf-Lists@ralfgross.de Precedence: bulk X-list: xfs Barry Naujok schrieb: > > > >Reading the "Repairing a possibly incomplete xfs_growfs command?" thread > >this month makes me wonder if there is some type of rough formula or > >guesstimation cheat sheet to figure out how much memory and swap one > >would need for an xfs_repair given a file system with many terabytes. > > > > > >Say I have an 8TB LUN that needs an xfs_repair. What would be the rough > >memory requirements and swap space? > > > > General rule of thumb at the moment is 128MB of RAM/TB of filesystem > plus 4MB/million inodes on that filesystem. Did this change lately? I found the rule of thumb: 2 GB RAM for 1 TB of disk storage + some RAM per x inodes. http://oss.sgi.com/archives/xfs/2005-08/msg00045.html I'm interested in this too, because we'll get additional 15 TB disk space soon. Until now I created filesystems of max 7-8 TB on a server with 16 GB RAM. The 15 TB (mostly 2-5 GB large files) will be used on a server with only 6 GB RAM (debian etch, xfsprogs 2.8.11-1). We plan to expand the RAM to 12 GB. What size would be safe for a xfs filesystem on a server with 12 GB RAM (given mostly large files)? Ralf From owner-xfs@oss.sgi.com Wed Jan 23 03:00:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jan 2008 03:01:01 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0NB0sbT008865 for ; Wed, 23 Jan 2008 03:00:57 -0800 X-ASG-Debug-ID: 1201086070-7b7500420000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from enyo.dsw2k3.info (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 59700CD2E62 for ; Wed, 23 Jan 2008 03:01:13 -0800 (PST) Received: from enyo.dsw2k3.info (enyo.dsw2k3.info [195.71.86.239]) by cuda.sgi.com with ESMTP id Hjw3vHRp0O1m0Zlo for ; Wed, 23 Jan 2008 03:01:13 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by enyo.dsw2k3.info (Postfix) with ESMTP id 07E202BDEB for ; Wed, 23 Jan 2008 12:00:37 +0100 (CET) X-Virus-Scanned: ClamAV 0.91.2/5529/Wed Jan 23 00:45:56 2008 on oss.sgi.com X-Virus-Scanned: Debian amavisd-new at enyo.dsw2k3.info Received: from enyo.dsw2k3.info ([127.0.0.1]) by localhost (enyo.dsw2k3.info [127.0.0.1]) (amavisd-new, port 10024) with LMTP id iNXs4ePmjeGD for ; Wed, 23 Jan 2008 12:00:31 +0100 (CET) Received: from citd.de (p4FC4CF12.dip.t-dialin.net [79.196.207.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by enyo.dsw2k3.info (Postfix) with ESMTP id 9C1B52BD69 for ; Wed, 23 Jan 2008 12:00:30 +0100 (CET) Date: Wed, 23 Jan 2008 12:00:27 +0100 From: Matthias Schniedermeyer To: xfs@oss.sgi.com X-ASG-Orig-Subj: XFS doesn't correctly account for IO-Wait for directory reading Subject: XFS doesn't correctly account for IO-Wait for directory reading Message-ID: <20080123110027.GA10366@citd.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: enyo.dsw2k3.info[195.71.86.239] X-Barracuda-Start-Time: 1201086074 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-ASG-Whitelist: HEADER (^X-Barracuda-Connect: [^ ]+\.dsw2k3\.info\[) X-Virus-Status: Clean X-archive-position: 14265 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ms@citd.de Precedence: bulk X-list: xfs Hi Some days ago Mr. Chinner(?, don't have the e-mail anymore) said that XFS fakes ( :-) ) it's way around IO-wait accounting for file-deletion by deferring it to the log. Today i thought again about the initial 'rm -rf'-isn't-accounted-properly "problem", and the bigger part of "rm -rf" is the directory-traversal(IOW read) and not the actual "unlink"-part. So what better test than a simple 'find'. Situation: Cache is cold: find / >/dev/null While running (which takes some time) it shows exactly 0.0%wa in top on an otherwise completely idle system, where there should be a near 50%wa (Dual-Core system) or 100% on a UP system. For plain old file-reading the IO-Wait appears to show correctly (AFAICT). In a short test: cat > /dev/null peaked at 48%wa (said Dual-Core) with an average around 45%wa. SO how das XFS fake around IO-wait accounting this time? Unfortunatly i don't have any sufficiently large non-XFS-filesystems to do a good(tm) comparison, but a test on a small ext3-fs appeared to correctly(tm) account IO-Wait in directory traversal. Tested Kernels: 2.6.23 & 2.6.24rc6 Bis denn -- Real Programmers consider "what you see is what you get" to be just as bad a concept in Text Editors as it is in women. No, the Real Programmer wants a "you asked for it, you got it" text editor -- complicated, cryptic, powerful, unforgiving, dangerous. From owner-xfs@oss.sgi.com Wed Jan 23 04:17:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jan 2008 04:17:38 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0NCHSDx014006 for ; Wed, 23 Jan 2008 04:17:31 -0800 X-ASG-Debug-ID: 1201090662-7f4a00750000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from pentafluge.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DF07354E0DB for ; Wed, 23 Jan 2008 04:17:43 -0800 (PST) Received: from pentafluge.infradead.org (pentafluge.infradead.org [213.146.154.40]) by cuda.sgi.com with ESMTP id pGmxEgl1VHsFCckC for ; Wed, 23 Jan 2008 04:17:43 -0800 (PST) Received: from hch by pentafluge.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1JHeY1-0006T2-My; Wed, 23 Jan 2008 12:17:41 +0000 Date: Wed, 23 Jan 2008 12:17:41 +0000 From: Christoph Hellwig To: Matthias Schniedermeyer Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS doesn't correctly account for IO-Wait for directory reading Subject: Re: XFS doesn't correctly account for IO-Wait for directory reading Message-ID: <20080123121741.GA24405@infradead.org> References: <20080123110027.GA10366@citd.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080123110027.GA10366@citd.de> User-Agent: Mutt/1.5.17 (2007-11-01) X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: pentafluge.infradead.org[213.146.154.40] X-Barracuda-Start-Time: 1201090668 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40266 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5531/Wed Jan 23 02:32:09 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14266 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 Try this one-liner patch which should give you much better I/O wait reporting. There's some more I/O waits hidden in the log code, but to fix this we'd need to dig into the sv_t abstraction. Given that it only has four users left I'm probably going to simply remove it and fix the I/O wait accounting while I'm at it. --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_buf.c 2008-01-23 13:08:48.000000000 +0100 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_buf.c 2008-01-23 13:08:54.000000000 +0100 @@ -976,7 +976,7 @@ xfs_buf_wait_unpin( break; if (atomic_read(&bp->b_io_remaining)) blk_run_address_space(bp->b_target->bt_mapping); - schedule(); + io_schedule(); } remove_wait_queue(&bp->b_waiters, &wait); set_current_state(TASK_RUNNING); From owner-xfs@oss.sgi.com Wed Jan 23 05:26:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jan 2008 05:26:52 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,J_CHICKENPOX_38, J_CHICKENPOX_48 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0NDQhGY023115 for ; Wed, 23 Jan 2008 05:26:46 -0800 X-ASG-Debug-ID: 1201094823-256201430000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.suse.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DAC2C122EC29 for ; Wed, 23 Jan 2008 05:27:03 -0800 (PST) Received: from mx1.suse.de (mail.suse.de [195.135.220.2]) by cuda.sgi.com with ESMTP id BFfK97bPYvVoMhDM for ; Wed, 23 Jan 2008 05:27:03 -0800 (PST) X-ASG-Whitelist: Client Received: from Relay1.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id D6D8326AC4; Wed, 23 Jan 2008 14:27:00 +0100 (CET) Date: Wed, 23 Jan 2008 14:27:00 +0100 From: Jan Blunck To: Linda Walsh Cc: linux-btrace@vger.kernel.org, Linux-Xfs X-ASG-Orig-Subj: Re: blktrace & btrace usability Subject: Re: blktrace & btrace usability Message-ID: <20080123132700.GI4531@hasse.suse.de> References: <47906577.8090604@tlinx.org> <20080122164145.GB4531@hasse.suse.de> <47964B66.5020001@tlinx.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47964B66.5020001@tlinx.org> Organization: SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 (AG Nuernberg) User-Agent: Mutt/1.5.17 (2007-11-01) X-Barracuda-Connect: mail.suse.de[195.135.220.2] X-Barracuda-Start-Time: 1201094823 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/5531/Wed Jan 23 02:32:09 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14267 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jblunck@suse.de Precedence: bulk X-list: xfs On Tue, Jan 22, Linda Walsh wrote: > Jan Blunck wrote: >> blktrace is used by the preload package. The preload package is capable of >> remapping blocks for faster booting. Therefore we need the blktrace >> output. But we only have a remapper for ext3. >> > ---- > I wondered about that, but the blktrace package doesn't containg > any utility for remapping blocks. The blktrace-0.99.3-12 package > included in OSuse-10.3, I only see utilities "blkparse, blktrace, btrace, > blkrawverify, btt, and verify_blktrace". > Was it left out by accident? ---or--- No, this is the reason why I said "blktrace is used by the preload package". The ext3remapper is part of the preload package. > If the remapping is in a separate package, then shouldn't > the blktrace package "just" do the block tracing, regardless > of file type (i.e. in typical unix fashion, it does its part, and > another util (a block-re-arranger) does its part...? Yes it is just doing that. If you only have a remapper for ext3 (I wasn't aware of XFS) there is no point in gathering the blktrace data for other filesystem. boot.blktrace, which is the script you are refering to is part of the preload package. Remember that we haven't changed blktrace that it only works for ext3 or something similar. > Having blktrace do it's thing no matter what filesystem > follows might encourage or enable someone to write re-arrangers > for other filesystems...(?) After all, xfs already has > one block-rearranger program (for what little it is needed) > in "xfs_fsr". Does ext3 have something similar now? Yes, the ext3remapper written by Jan Kara. From owner-xfs@oss.sgi.com Wed Jan 23 06:24:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jan 2008 06:24:43 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0NEOYOB026370 for ; Wed, 23 Jan 2008 06:24:37 -0800 X-ASG-Debug-ID: 1201098291-486500dc0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from enyo.dsw2k3.info (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2002E54ED61 for ; Wed, 23 Jan 2008 06:24:52 -0800 (PST) Received: from enyo.dsw2k3.info (enyo.dsw2k3.info [195.71.86.239]) by cuda.sgi.com with ESMTP id BRV2qFhz6jFmEDKr for ; Wed, 23 Jan 2008 06:24:52 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by enyo.dsw2k3.info (Postfix) with ESMTP id 759A52BDDA; Wed, 23 Jan 2008 15:24:50 +0100 (CET) X-Virus-Scanned: ClamAV 0.91.2/5531/Wed Jan 23 02:32:09 2008 on oss.sgi.com X-Virus-Scanned: Debian amavisd-new at enyo.dsw2k3.info Received: from enyo.dsw2k3.info ([127.0.0.1]) by localhost (enyo.dsw2k3.info [127.0.0.1]) (amavisd-new, port 10024) with LMTP id cHZqtCv1RsyI; Wed, 23 Jan 2008 15:24:45 +0100 (CET) Received: from citd.de (p4FC4CF12.dip.t-dialin.net [79.196.207.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by enyo.dsw2k3.info (Postfix) with ESMTP id CE88D2BD61; Wed, 23 Jan 2008 15:24:44 +0100 (CET) Date: Wed, 23 Jan 2008 15:24:42 +0100 From: Matthias Schniedermeyer To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS doesn't correctly account for IO-Wait for directory reading Subject: Re: XFS doesn't correctly account for IO-Wait for directory reading Message-ID: <20080123142442.GA12440@citd.de> References: <20080123110027.GA10366@citd.de> <20080123121741.GA24405@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080123121741.GA24405@infradead.org> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: enyo.dsw2k3.info[195.71.86.239] X-Barracuda-Start-Time: 1201098295 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-ASG-Whitelist: HEADER (^X-Barracuda-Connect: [^ ]+\.dsw2k3\.info\[) X-Virus-Status: Clean X-archive-position: 14268 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ms@citd.de Precedence: bulk X-list: xfs On 23.01.2008 12:17, Christoph Hellwig wrote: > > Try this one-liner patch which should give you much better I/O wait > reporting. There's some more I/O waits hidden in the log code, but to > fix this we'd need to dig into the sv_t abstraction. Given that it only > has four users left I'm probably going to simply remove it and fix the > I/O wait accounting while I'm at it. Either with 2.6.23.12 & 2.6.24-git-HEAD, and the shown line changed, the %wa reported by top is still at 0.0 Bis denn -- Real Programmers consider "what you see is what you get" to be just as bad a concept in Text Editors as it is in women. No, the Real Programmer wants a "you asked for it, you got it" text editor -- complicated, cryptic, powerful, unforgiving, dangerous. From owner-xfs@oss.sgi.com Wed Jan 23 09:15:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jan 2008 09:15:40 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: ** X-Spam-Status: No, score=2.8 required=5.0 tests=BAYES_40,HTML_MESSAGE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0NHFXVo010539 for ; Wed, 23 Jan 2008 09:15:38 -0800 X-ASG-Debug-ID: 1201108550-4864026d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from rv-out-0910.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 87C405502AD for ; Wed, 23 Jan 2008 09:15:50 -0800 (PST) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.191]) by cuda.sgi.com with ESMTP id Z6dpJOs6LXLXmvm3 for ; Wed, 23 Jan 2008 09:15:50 -0800 (PST) Received: by rv-out-0910.google.com with SMTP id k20so2112761rvb.32 for ; Wed, 23 Jan 2008 09:15:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=J1waUmgjbmCdkaxlFAK9G/3I8AXNjJ0Wldd0D+thYHM=; b=HD1cFmw1dfpnE/wkvBwVyGDRVWKyxGbqnP7j+s0ZXFg+ZESaHEn1OJilxZvqZFPqERrs+m+QMcUGcJWeTeGfs9WpevbFx5YUZoTn9luuqB9+PlRfhZ1QYruhHHotxDmI4bhwHKodaRYfD6+AV8+UOTrh0TpEtFeY6mwa0aQdkGA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=BLKXv2NDro/KH2N/mCnA4Euqx3LF/cfsfVVZ7AxSk3oO4Aayw0HZQqcH+e9AYq5yXCU8LbsB9/JMpX1kex0aevW0LojbKWJ5EQkGz8n5M8xtvgJLNYEPT04yvNttvO2FX1H1dw+TH37FBJeTyPGM5KEeweM8/dEBY1rqNNMvXEM= Received: by 10.141.37.8 with SMTP id p8mr6506430rvj.178.1201108549126; Wed, 23 Jan 2008 09:15:49 -0800 (PST) Received: by 10.64.233.11 with HTTP; Wed, 23 Jan 2008 09:15:49 -0800 (PST) Message-ID: <4f52331f0801230915p1d3c4c3ala010d9066addb411@mail.gmail.com> Date: Wed, 23 Jan 2008 09:15:49 -0800 From: "Fong Vang" To: xfs@oss.sgi.com X-ASG-Orig-Subj: XFS file system corrupted beyond repair? Subject: XFS file system corrupted beyond repair? MIME-Version: 1.0 X-Barracuda-Connect: rv-out-0910.google.com[209.85.198.191] X-Barracuda-Start-Time: 1201108553 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.38 X-Barracuda-Spam-Status: No, SCORE=-1.38 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=HTML_00_10, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40284 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.64 HTML_00_10 BODY: Message is 0% to 10% HTML 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/5531/Wed Jan 23 02:32:09 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 558 X-archive-position: 14269 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sudoyang@gmail.com Precedence: bulk X-list: xfs One of our servers cannot mount an XFS file system after reboot. xfs_check and xfs_repair cannot fix the problem. Both indicate that there are no valid superblock can be found. Are there any tool that can help reconstruct the file system. Doing a hexdump of the partition, it appears there are valid filenames still on there. Also, the disk has no bad block or hardware issues. Is there anyone on the XFS development team that we can hire to examine the file system more closely and see if it can be reconstructed? [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Wed Jan 23 09:24:06 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jan 2008 09:24:09 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0NHO48G011223 for ; Wed, 23 Jan 2008 09:24:06 -0800 X-ASG-Debug-ID: 1201109061-3cce02140000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.purevideo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0CFFC122F2EE for ; Wed, 23 Jan 2008 09:24:21 -0800 (PST) Received: from mail.purevideo.com (mail.purevideo.com [208.50.29.149]) by cuda.sgi.com with ESMTP id 2AKTUj7sAsQhIY5N for ; Wed, 23 Jan 2008 09:24:21 -0800 (PST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-ASG-Orig-Subj: RE: XFS file system corrupted beyond repair? Subject: RE: XFS file system corrupted beyond repair? Date: Wed, 23 Jan 2008 09:18:56 -0800 Message-ID: <9CE70E6ED2C2F64FB5537A2973FA4F02535972@pvn-3001.purevideo.local> In-Reply-To: <4f52331f0801230915p1d3c4c3ala010d9066addb411@mail.gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: XFS file system corrupted beyond repair? Thread-Index: Achd4vjZWg5eNUzMTqmGJflk/AvZjwAAbEog References: <4f52331f0801230915p1d3c4c3ala010d9066addb411@mail.gmail.com> From: "Mark Magpayo" To: "Fong Vang" , X-Barracuda-Connect: mail.purevideo.com[208.50.29.149] X-Barracuda-Start-Time: 1201109064 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40285 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5531/Wed Jan 23 02:32:09 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m0NHO68G011225 X-archive-position: 14270 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: mmagpayo@purevideo.com Precedence: bulk X-list: xfs > -----Original Message----- > From: xfs-bounce@oss.sgi.com [mailto:xfs-bounce@oss.sgi.com] On Behalf Of > Fong Vang > Sent: Wednesday, January 23, 2008 9:16 AM > To: xfs@oss.sgi.com > Subject: XFS file system corrupted beyond repair? > > One of our servers cannot mount an XFS file system after reboot. > xfs_check > and xfs_repair cannot fix the problem. Both indicate that there are no > valid superblock can be found. Are there any tool that can help > reconstruct > the file system. Doing a hexdump of the partition, it appears there are > valid filenames still on there. Also, the disk has no bad block or > hardware > issues. > > Is there anyone on the XFS development team that we can hire to examine > the > file system more closely and see if it can be reconstructed? > > > [[HTML alternate version deleted]] > Check the archive for a thread entitled "Repairing a possibly incomplete xfs_growfs command?" (It's pretty recent) I had this issue last week and the XFS guys were able to help me out. Maybe there is something in there that can help. Most notably, check the output of this command: # xfs_db -r -c 'sb 0' -c p If you see agcount = 160, then the solutions provided may apply to your situation as well. Cheers, Mark From owner-xfs@oss.sgi.com Wed Jan 23 09:29:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jan 2008 09:29:22 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0NHTGM3011719 for ; Wed, 23 Jan 2008 09:29:19 -0800 X-ASG-Debug-ID: 1201109375-122701ea0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.purevideo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 16AB2550649 for ; Wed, 23 Jan 2008 09:29:36 -0800 (PST) Received: from mail.purevideo.com (mail.purevideo.com [208.50.29.149]) by cuda.sgi.com with ESMTP id ymPyvpD3IyvOZwuC for ; Wed, 23 Jan 2008 09:29:36 -0800 (PST) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-ASG-Orig-Subj: RE: Repairing a possibly incomplete xfs_growfs command? Subject: RE: Repairing a possibly incomplete xfs_growfs command? Date: Wed, 23 Jan 2008 09:24:17 -0800 Message-ID: <9CE70E6ED2C2F64FB5537A2973FA4F02535973@pvn-3001.purevideo.local> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Repairing a possibly incomplete xfs_growfs command? Thread-Index: AchdauQ1LMoKfLlGTMic03LLn0M+6gAeoQ+w References: <9CE70E6ED2C2F64FB5537A2973FA4F0253595A@pvn-3001.purevideo.local> <20080117234604.GG155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253595B@pvn-3001.purevideo.local> <20080119004018.GH155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253596D@pvn-3001.purevideo.local> From: "Mark Magpayo" To: "Barry Naujok" Cc: X-Barracuda-Connect: mail.purevideo.com[208.50.29.149] X-Barracuda-Start-Time: 1201109376 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40286 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5531/Wed Jan 23 02:32:09 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m0NHTJM3011737 X-archive-position: 14271 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: mmagpayo@purevideo.com Precedence: bulk X-list: xfs > > Was it stuck on Phase 6 all that time? With only 1GB of RAM (from your > meminfo output) and 18TB filesystem, Phases 3 and 4 will take a very > long time due to swapping. It's been stuck on Phase 6 since I came back to check on it on Monday. > > Phase 6 in your scenario should be relatively quick and light on > memory usage (500MB as reported in your other email). > > It is feasible it is deadlocked by trying to double-access a buffer, > or access a buffer that wasn't released. This is an unlikely scenario, > but it is possible. Could I break out of the process here? Seems like most of the repair work has been done... Then again, I imagine traversing the filesystem is a pretty important step. Are there any more phases after this by the way? Thanks, Mark From owner-xfs@oss.sgi.com Wed Jan 23 15:17:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jan 2008 15:17:42 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_38 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0NNHCtZ007089 for ; Wed, 23 Jan 2008 15:17:15 -0800 X-ASG-Debug-ID: 1201130252-7608023a0000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ishtar.tlinx.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 664C7552A53 for ; Wed, 23 Jan 2008 15:17:32 -0800 (PST) Received: from ishtar.tlinx.org (ishtar.tlinx.org [64.81.245.74]) by cuda.sgi.com with ESMTP id aFAHnrFLGyXyzEmY for ; Wed, 23 Jan 2008 15:17:32 -0800 (PST) Received: from [192.168.3.11] (Athena [192.168.3.11]) by ishtar.tlinx.org (8.13.3/8.12.10/SuSE Linux 0.7) with ESMTP id m0NNHU8q010299; Wed, 23 Jan 2008 15:17:30 -0800 Message-ID: <4797CB0A.7050406@tlinx.org> Date: Wed, 23 Jan 2008 15:17:30 -0800 From: Linda Walsh User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Jan Blunck CC: linux-btrace@vger.kernel.org, Linux-Xfs X-ASG-Orig-Subj: Re: blktrace & btrace usability Subject: Re: blktrace & btrace usability References: <47906577.8090604@tlinx.org> <20080122164145.GB4531@hasse.suse.de> <47964B66.5020001@tlinx.org> <20080123132700.GI4531@hasse.suse.de> In-Reply-To: <20080123132700.GI4531@hasse.suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: ishtar.tlinx.org[64.81.245.74] X-Barracuda-Start-Time: 1201130252 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40309 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5532/Wed Jan 23 13:08:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14272 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lkml@tlinx.org Precedence: bulk X-list: xfs Jan Blunck wrote: > On Tue, Jan 22, Linda Walsh wrote: > > >> Jan Blunck wrote: >> >>> blktrace is used by the preload package. The preload package is capable of >>> remapping blocks for faster booting. Therefore we need the blktrace >>> output. But we only have a remapper for ext3. >>> >>> >> ---- >> I wondered about that, but the blktrace package doesn't containg >> any utility for remapping blocks. The blktrace-0.99.3-12 package >> included in OSuse-10.3, I only see utilities "blkparse, blktrace, btrace, >> blkrawverify, btt, and verify_blktrace". >> Was it left out by accident? ---or--- >> > > No, this is the reason why I said "blktrace is used by the preload > package". The ext3remapper is part of the preload package. > ---- Ahh...I'm sorry, I didn't know that the blktrace rc-scripts were unrelated to the blktrace package and that by preload package you meant a package named "preload" (I thought preload was some other phase that I didn't know about that happened before other packages were processed, or something). I got confused by the names (no idea why...*cough*)... I'm not sure why the package, "preload", got installed and "chkconfig'ed on" when I have no ext{23} disks. I have "personal" issues with each new version adding more automatically run "services". Reminds me more and more of WinXP with all its auto-start boot progs & services and how it initially (pre-SP2), installed with most services turned on (even though they weren't needed by most users). In a similar way, SuSE organizes its rpms to "require" features (packages) that I don't want and don't need (avahi an apple-ad-hoc networking util with most of gnome requiring its presence). xfs has a file-system re-organizer, but its design goal (probably ~10 years back) was simply to coalesce discontiguous file parts to speed up speed sensitive real-time video streaming. If it was deemed important, the existing xfs_fsr might be adaptable... Sorry for my confusion..., from the names "boot.blktrace" & "stopblktrace", I thought they were general scripts for recording the "boot+rc" block actions -- not specifically for the package named "preload". -l From owner-xfs@oss.sgi.com Wed Jan 23 16:28:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jan 2008 16:28:29 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0O0SL7l016072 for ; Wed, 23 Jan 2008 16:28:23 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA05830; Thu, 24 Jan 2008 11:28:32 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0O0SVLF36811788; Thu, 24 Jan 2008 11:28:31 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0O0SSBZ36827238; Thu, 24 Jan 2008 11:28:28 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 24 Jan 2008 11:28:28 +1100 From: David Chinner To: Ralf Gross Cc: Barry Naujok , xfs@oss.sgi.com Subject: Re: xfs_rapair memory requirement per TB Message-ID: <20080124002828.GC155259@sgi.com> References: <1201042882.32649.256.camel@holwrs01.bp.com> <20080123085339.GB12435@p15145560.pureserver.info> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080123085339.GB12435@p15145560.pureserver.info> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5532/Wed Jan 23 13:08:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14273 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Wed, Jan 23, 2008 at 09:53:39AM +0100, Ralf Gross wrote: > Barry Naujok schrieb: > > > > > >Reading the "Repairing a possibly incomplete xfs_growfs command?" thread > > >this month makes me wonder if there is some type of rough formula or > > >guesstimation cheat sheet to figure out how much memory and swap one > > >would need for an xfs_repair given a file system with many terabytes. > > > > > > > > >Say I have an 8TB LUN that needs an xfs_repair. What would be the rough > > >memory requirements and swap space? > > > > > > > General rule of thumb at the moment is 128MB of RAM/TB of filesystem > > plus 4MB/million inodes on that filesystem. > > Did this change lately? I found the rule of thumb: 2 GB RAM for 1 TB > of disk storage + some RAM per x inodes. The above is based on actual theoretical usage, the below: > http://oss.sgi.com/archives/xfs/2005-08/msg00045.html was based on reported usage on during live repair runs. I think Barry discovered the difference to be things external to repair such as heap fragmentation and has since corrected the worst of the issues so requirements are, in general, much closer to the theoretical numbers now. Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Wed Jan 23 16:31:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jan 2008 16:31:12 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0O0V21Z016499 for ; Wed, 23 Jan 2008 16:31:06 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA06026; Thu, 24 Jan 2008 11:31:17 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0O0VGLF36783747; Thu, 24 Jan 2008 11:31:17 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0O0VEe936745970; Thu, 24 Jan 2008 11:31:14 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 24 Jan 2008 11:31:14 +1100 From: David Chinner To: Matthias Schniedermeyer Cc: xfs@oss.sgi.com Subject: Re: XFS doesn't correctly account for IO-Wait for directory reading Message-ID: <20080124003114.GD155259@sgi.com> References: <20080123110027.GA10366@citd.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080123110027.GA10366@citd.de> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5532/Wed Jan 23 13:08:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14274 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Wed, Jan 23, 2008 at 12:00:27PM +0100, Matthias Schniedermeyer wrote: > Hi > > > Some days ago Mr. Chinner(?, don't have the e-mail anymore) said that > XFS fakes ( :-) ) it's way around IO-wait accounting for file-deletion > by deferring it to the log. > > Today i thought again about the initial 'rm -rf'-isn't-accounted-properly > "problem", and the bigger part of "rm -rf" is the > directory-traversal(IOW read) and not the actual "unlink"-part. > > So what better test than a simple 'find'. > > Situation: Cache is cold: > find / >/dev/null > While running (which takes some time) it shows exactly 0.0%wa in top on > an otherwise completely idle system, where there should be a near 50%wa > (Dual-Core system) or 100% on a UP system. XFS issues readahead on directories, so when the I/O has not completed, it waits on semaphores in the xfs_buf layer, not on the I/O itself. Hence we cannot account for the wait time as iowait as we cannot tell the semaphore to call io_schedule() instead of schedule(). Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Wed Jan 23 17:01:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jan 2008 17:01:39 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0O11UeB019097 for ; Wed, 23 Jan 2008 17:01:35 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA06822; Thu, 24 Jan 2008 12:01:43 +1100 Date: Thu, 24 Jan 2008 12:02:09 +1100 To: "Mark Magpayo" Subject: Re: Repairing a possibly incomplete xfs_growfs command? From: "Barry Naujok" Organization: SGI Cc: xfs@oss.sgi.com Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <9CE70E6ED2C2F64FB5537A2973FA4F0253595A@pvn-3001.purevideo.local> <20080117234604.GG155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253595B@pvn-3001.purevideo.local> <20080119004018.GH155407@sgi.com> <9CE70E6ED2C2F64FB5537A2973FA4F0253596D@pvn-3001.purevideo.local> <9CE70E6ED2C2F64FB5537A2973FA4F02535973@pvn-3001.purevideo.local> Message-ID: In-Reply-To: <9CE70E6ED2C2F64FB5537A2973FA4F02535973@pvn-3001.purevideo.local> User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5532/Wed Jan 23 13:08:36 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from Quoted-Printable to 8bit by oss.sgi.com id m0O11aeB019101 X-archive-position: 14275 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Thu, 24 Jan 2008 04:24:17 +1100, Mark Magpayo wrote: >> >> Was it stuck on Phase 6 all that time? With only 1GB of RAM (from your >> meminfo output) and 18TB filesystem, Phases 3 and 4 will take a very >> long time due to swapping. > > It's been stuck on Phase 6 since I came back to check on it on Monday. > > >> >> Phase 6 in your scenario should be relatively quick and light on >> memory usage (500MB as reported in your other email). >> >> It is feasible it is deadlocked by trying to double-access a buffer, >> or access a buffer that wasn't released. This is an unlikely scenario, >> but it is possible. > > Could I break out of the process here? Seems like most of the repair > work has been done... Then again, I imagine traversing the filesystem > is a pretty important step. Breaking repair is fine. > Are there any more phases after this by the way? Checking nlink counts in Phase 7 is the last. I would run xfs_check to see if there are any errors remaining. The other thing I can suggest is to run an older repair from the 2.8.x series (2.8.21) with the options "-M -o bhash=512". This should finish. Regards, Barry. From owner-xfs@oss.sgi.com Wed Jan 23 17:25:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jan 2008 17:25:59 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0O1PniG020553 for ; Wed, 23 Jan 2008 17:25:53 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA07393; Thu, 24 Jan 2008 12:26:02 +1100 Date: Thu, 24 Jan 2008 12:26:34 +1100 To: "David Chinner" , "Ralf Gross" Subject: Re: xfs_rapair memory requirement per TB From: "Barry Naujok" Organization: SGI Cc: xfs@oss.sgi.com Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <1201042882.32649.256.camel@holwrs01.bp.com> <20080123085339.GB12435@p15145560.pureserver.info> <20080124002828.GC155259@sgi.com> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <20080124002828.GC155259@sgi.com> User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5532/Wed Jan 23 13:08:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14276 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Thu, 24 Jan 2008 11:28:28 +1100, David Chinner wrote: > On Wed, Jan 23, 2008 at 09:53:39AM +0100, Ralf Gross wrote: >> Barry Naujok schrieb: >> > > >> > >Reading the "Repairing a possibly incomplete xfs_growfs command?" >> thread >> > >this month makes me wonder if there is some type of rough formula or >> > >guesstimation cheat sheet to figure out how much memory and swap one >> > >would need for an xfs_repair given a file system with many terabytes. >> > > >> > > >> > >Say I have an 8TB LUN that needs an xfs_repair. What would be the >> rough >> > >memory requirements and swap space? >> > > >> > >> > General rule of thumb at the moment is 128MB of RAM/TB of filesystem >> > plus 4MB/million inodes on that filesystem. >> >> Did this change lately? I found the rule of thumb: 2 GB RAM for 1 TB >> of disk storage + some RAM per x inodes. > > The above is based on actual theoretical usage, the below: > >> http://oss.sgi.com/archives/xfs/2005-08/msg00045.html > > was based on reported usage on during live repair runs. > > I think Barry discovered the difference to be things external > to repair such as heap fragmentation and has since corrected > the worst of the issues so requirements are, in general, > much closer to the theoretical numbers now. Yes, quite a few memory improvements have been made. Right now, I can repair a 9TB filesystem with ~150 million inodes in 2GB of RAM without going to swap using xfs_repair 2.9.4 and with no custom/tuning/config options. Regards, Barry. From owner-xfs@oss.sgi.com Wed Jan 23 18:06:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jan 2008 18:06:57 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0O26isL022620 for ; Wed, 23 Jan 2008 18:06:47 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA08444; Thu, 24 Jan 2008 13:06:59 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0O26wLF36877328; Thu, 24 Jan 2008 13:06:59 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0O26uY036872880; Thu, 24 Jan 2008 13:06:56 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Thu, 24 Jan 2008 13:06:56 +1100 From: David Chinner To: Fong Vang Cc: xfs@oss.sgi.com Subject: Re: XFS file system corrupted beyond repair? Message-ID: <20080124020656.GE155259@sgi.com> References: <4f52331f0801230915p1d3c4c3ala010d9066addb411@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4f52331f0801230915p1d3c4c3ala010d9066addb411@mail.gmail.com> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5532/Wed Jan 23 13:08:36 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14277 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Wed, Jan 23, 2008 at 09:15:49AM -0800, Fong Vang wrote: > One of our servers cannot mount an XFS file system after reboot. xfs_check > and xfs_repair cannot fix the problem. Both indicate that there are no > valid superblock can be found. What happened before the reboot? FWIW, is this on a md block device? If so, did it reconstruct correctly? To find out what is in the superblock, can you post the output of 'xfs_db -r -c "sb 0" -c p '? Also, it could be instructive to see the exact errors check and repair were outputting. Can you post the output of failing xfs_repair/xfs_check? Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Thu Jan 24 07:50:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jan 2008 07:50:29 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=AWL,BAYES_00,RCVD_NUMERIC_HELO autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0OFoN1E021946 for ; Thu, 24 Jan 2008 07:50:25 -0800 X-ASG-Debug-ID: 1201189843-78eb00590000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail161.messagelabs.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id B768B5569F7 for ; Thu, 24 Jan 2008 07:50:43 -0800 (PST) Received: from mail161.messagelabs.com (mail161.messagelabs.com [216.82.253.115]) by cuda.sgi.com with SMTP id tb098A8DjyklIh9f for ; Thu, 24 Jan 2008 07:50:43 -0800 (PST) X-VirusChecked: Checked X-Env-Sender: salmr0@bp.com X-Msg-Ref: server-6.tower-161.messagelabs.com!1201189841!10611962!1 X-StarScan-Version: 5.5.12.14.2; banners=-,-,- X-Originating-IP: [129.230.248.44] Received: (qmail 25720 invoked from network); 24 Jan 2008 15:50:42 -0000 Received: from unknown (HELO bp1xeuav001.bp1.ad.bp.com) (129.230.248.44) by server-6.tower-161.messagelabs.com with SMTP; 24 Jan 2008 15:50:42 -0000 Received: from bp1xeuex712.bp1.ad.bp.com ([149.182.218.243]) by bp1xeuav001.bp1.ad.bp.com with InterScan Messaging Security Suite; Thu, 24 Jan 2008 15:50:17 -0000 Received: from BP1XEUEX706-C.bp1.ad.bp.com ([149.182.218.110]) by bp1xeuex712.bp1.ad.bp.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 24 Jan 2008 15:50:17 +0000 Received: from 149.179.228.36 ([149.179.228.36]) by BP1XEUEX706-C.bp1.ad.bp.com ([149.182.218.28]) with Microsoft Exchange Server HTTP-DAV ; Thu, 24 Jan 2008 15:50:16 +0000 Received: from holwrs01 by BP1XEUEX706-C.bp1.ad.bp.com; 24 Jan 2008 09:50:16 -0600 X-ASG-Orig-Subj: Re: xfs_rapair memory requirement per TB Subject: Re: xfs_rapair memory requirement per TB From: Rene Salmon To: Barry Naujok Cc: David Chinner , Ralf Gross , xfs@oss.sgi.com In-Reply-To: References: <1201042882.32649.256.camel@holwrs01.bp.com> <20080123085339.GB12435@p15145560.pureserver.info> <20080124002828.GC155259@sgi.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Thu, 24 Jan 2008 09:50:16 -0600 Message-Id: <1201189816.32649.358.camel@holwrs01.bp.com> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 X-OriginalArrivalTime: 24 Jan 2008 15:50:17.0308 (UTC) FILETIME=[D0EDC1C0:01C85EA0] X-Barracuda-Connect: mail161.messagelabs.com[216.82.253.115] X-Barracuda-Start-Time: 1201189843 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.77 X-Barracuda-Spam-Status: No, SCORE=-0.77 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=RCVD_NUMERIC_HELO, UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40372 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.25 RCVD_NUMERIC_HELO Received: contains an IP address used for HELO 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-Virus-Scanned: ClamAV 0.91.2/5544/Thu Jan 24 03:02:44 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14278 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: salmr0@bp.com Precedence: bulk X-list: xfs > >> > > >> > General rule of thumb at the moment is 128MB of RAM/TB of > filesystem > >> > plus 4MB/million inodes on that filesystem. > >> > >> Did this change lately? I found the rule of thumb: 2 GB RAM for 1 > TB > >> of disk storage + some RAM per x inodes. > > > > The above is based on actual theoretical usage, the below: > > > >> http://oss.sgi.com/archives/xfs/2005-08/msg00045.html > > > > was based on reported usage on during live repair runs. > > > > I think Barry discovered the difference to be things external > > to repair such as heap fragmentation and has since corrected > > the worst of the issues so requirements are, in general, > > much closer to the theoretical numbers now. > > Yes, quite a few memory improvements have been made. > > Right now, I can repair a 9TB filesystem with ~150 million inodes > in 2GB of RAM without going to swap using xfs_repair 2.9.4 and > with no custom/tuning/config options. Thanks. That is great news about the memory improvements. We currently run SLES 10 SP1 which comes with: hpcxe005:# xfs_repair -V xfs_repair version 2.8.16 others come with: hpcxe001:~ # xfs_repair -V xfs_repair version 2.9.2 Did the memory improvements make it into 2.8.16? How about 2.9.2? If not i take it we can download the latest source and just have the 2.9.4 xfs_repair binary laying around in case we ever need to use it. Would using a 2.9.4 xfs_repair binary on a 2.8.16 created xfs file system cause any problems? Thanks Rene > From owner-xfs@oss.sgi.com Thu Jan 24 08:07:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jan 2008 08:07:24 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0OG7GHb023128 for ; Thu, 24 Jan 2008 08:07:21 -0800 X-ASG-Debug-ID: 1201190855-553c03aa0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from stlx01.stz-softwaretechnik.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5F70B556F99 for ; Thu, 24 Jan 2008 08:07:36 -0800 (PST) Received: from stlx01.stz-softwaretechnik.com (stz-softwaretechnik.de [217.160.223.211]) by cuda.sgi.com with ESMTP id nnrDqAVa4gEmnqlL for ; Thu, 24 Jan 2008 08:07:36 -0800 (PST) Received: from rg by stlx01.stz-softwaretechnik.com with local (Exim 3.36 #1 (Debian)) id 1JI4bs-0006U8-00 for ; Thu, 24 Jan 2008 17:07:24 +0100 Date: Thu, 24 Jan 2008 17:07:14 +0100 From: Ralf Gross To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs_rapair memory requirement per TB Subject: Re: xfs_rapair memory requirement per TB Message-ID: <20080124160714.GB30433@p15145560.pureserver.info> References: <1201042882.32649.256.camel@holwrs01.bp.com> <20080123085339.GB12435@p15145560.pureserver.info> <20080124002828.GC155259@sgi.com> <1201189816.32649.358.camel@holwrs01.bp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1201189816.32649.358.camel@holwrs01.bp.com> User-Agent: Mutt/1.5.9i X-Barracuda-Connect: stz-softwaretechnik.de[217.160.223.211] X-Barracuda-Start-Time: 1201190856 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40372 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5544/Thu Jan 24 03:02:44 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14279 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Ralf-Lists@ralfgross.de Precedence: bulk X-list: xfs Rene Salmon schrieb: > ... > > Right now, I can repair a 9TB filesystem with ~150 million inodes > > in 2GB of RAM without going to swap using xfs_repair 2.9.4 and > > with no custom/tuning/config options. > > Thanks. That is great news about the memory improvements. We currently > run SLES 10 SP1 which comes with: > > hpcxe005:# xfs_repair -V > xfs_repair version 2.8.16 > > others come with: > > hpcxe001:~ # xfs_repair -V > xfs_repair version 2.9.2 > > > Did the memory improvements make it into 2.8.16? How about 2.9.2? If not > i take it we can download the latest source and just have the 2.9.4 > xfs_repair binary laying around in case we ever need to use it. Would > using a 2.9.4 xfs_repair binary on a 2.8.16 created xfs file system > cause any problems? I did this today. Compiled 2.9.5 on debian etch and put it in /opt/xfsprogs. Just in case I need it. On #xfs I got the answer that xfs_check and xfs_repair should be fine for an fs that was created with an older mkfs.xfs. Ralf From owner-xfs@oss.sgi.com Thu Jan 24 16:00:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jan 2008 16:01:55 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_42 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0P00hIf029234 for ; Thu, 24 Jan 2008 16:00:46 -0800 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA12170; Fri, 25 Jan 2008 11:00:57 +1100 Date: Fri, 25 Jan 2008 11:01:09 +1100 To: "Rene Salmon" Subject: Re: xfs_rapair memory requirement per TB From: "Barry Naujok" Organization: SGI Cc: "Ralf Gross" , xfs@oss.sgi.com Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 References: <1201042882.32649.256.camel@holwrs01.bp.com> <20080123085339.GB12435@p15145560.pureserver.info> <20080124002828.GC155259@sgi.com> <1201189816.32649.358.camel@holwrs01.bp.com> Content-Transfer-Encoding: 7bit Message-ID: In-Reply-To: <1201189816.32649.358.camel@holwrs01.bp.com> User-Agent: Opera Mail/9.24 (Win32) X-Virus-Scanned: ClamAV 0.91.2/5546/Thu Jan 24 13:32:07 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14280 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs On Fri, 25 Jan 2008 02:50:16 +1100, Rene Salmon wrote: > > > > >> >> > >> >> > General rule of thumb at the moment is 128MB of RAM/TB of >> filesystem >> >> > plus 4MB/million inodes on that filesystem. >> >> >> >> Did this change lately? I found the rule of thumb: 2 GB RAM for 1 >> TB >> >> of disk storage + some RAM per x inodes. >> > >> > The above is based on actual theoretical usage, the below: >> > >> >> http://oss.sgi.com/archives/xfs/2005-08/msg00045.html >> > >> > was based on reported usage on during live repair runs. >> > >> > I think Barry discovered the difference to be things external >> > to repair such as heap fragmentation and has since corrected >> > the worst of the issues so requirements are, in general, >> > much closer to the theoretical numbers now. >> >> Yes, quite a few memory improvements have been made. >> >> Right now, I can repair a 9TB filesystem with ~150 million inodes >> in 2GB of RAM without going to swap using xfs_repair 2.9.4 and >> with no custom/tuning/config options. > > > > > Thanks. That is great news about the memory improvements. We currently > run SLES 10 SP1 which comes with: > > hpcxe005:# xfs_repair -V > xfs_repair version 2.8.16 > > others come with: > > hpcxe001:~ # xfs_repair -V > xfs_repair version 2.9.2 > > > Did the memory improvements make it into 2.8.16? How about 2.9.2? If not > i take it we can download the latest source and just have the 2.9.4 > xfs_repair binary laying around in case we ever need to use it. Would > using a 2.9.4 xfs_repair binary on a 2.8.16 created xfs file system > cause any problems? The memory improvements showed up in 2.9.2. As Ralf said, xfs_repair can always fix older mkfs'ed filesystems. Regards, Barry. From owner-xfs@oss.sgi.com Thu Jan 24 21:32:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jan 2008 21:32:29 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0P5WLf7026163 for ; Thu, 24 Jan 2008 21:32:24 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA20067; Fri, 25 Jan 2008 16:32:33 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0P5WULF38179295; Fri, 25 Jan 2008 16:32:31 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0P5WSjc38167077; Fri, 25 Jan 2008 16:32:28 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Fri, 25 Jan 2008 16:32:28 +1100 From: David Chinner To: Russell Cattelan Cc: xfs-oss Subject: [patch] Fix ctime/mtime update for truncate to same size Message-ID: <20080125053228.GR155259@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5548/Thu Jan 24 19:46:51 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14281 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs Russell, Can you test this change to see if it works for you. It appears to do the job here. Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group --- fs/xfs/xfs_vnodeops.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) Index: 2.6.x-xfs-new/fs/xfs/xfs_vnodeops.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfs_vnodeops.c 2008-01-25 16:03:23.654971763 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfs_vnodeops.c 2008-01-25 16:10:30.875397129 +1100 @@ -634,6 +634,15 @@ xfs_setattr( * Truncate file. Must have write permission and not be a directory. */ if (mask & XFS_AT_SIZE) { + /* + * Only change the c/mtime if we are changing the size + * or we are explicitly asked to change it. This handles + * the semantic difference between truncate() and ftruncate() + * as implemented in the VFS. + */ + if (vap->va_size != ip->i_size || mask & XFS_AT_CTIME) + timeflags |= XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG; + if (vap->va_size > ip->i_size) { xfs_igrow_finish(tp, ip, vap->va_size, !(flags & ATTR_DMI)); @@ -662,10 +671,6 @@ xfs_setattr( */ xfs_iflags_set(ip, XFS_ITRUNCATED); } - /* - * Have to do this even if the file's size doesn't change. - */ - timeflags |= XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG; } /* From owner-xfs@oss.sgi.com Thu Jan 24 22:50:43 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jan 2008 22:50:46 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0P6odNY031908 for ; Thu, 24 Jan 2008 22:50:42 -0800 Received: from timothy-shimmins-power-mac-g5.local (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA21536; Fri, 25 Jan 2008 17:50:55 +1100 Message-ID: <479986F5.7070800@sgi.com> Date: Fri, 25 Jan 2008 17:51:33 +1100 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: David Chinner CC: xfs-dev , xfs-oss Subject: Re: [patch] Prevent AIL lock contention during transaction completion References: <20080121052330.GG155259@sgi.com> <4796E8C8.3030702@sgi.com> <20080123073446.GU155259@sgi.com> In-Reply-To: <20080123073446.GU155259@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/5548/Thu Jan 24 19:46:51 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14282 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs David Chinner & Tim wrote: >> And xfs_log_move_tail is called by: >> * xfs_trans_update_ail, xfs_trans_delete_ail, >> (xfs_trans_unlocked_item and xlog_ungrant_log_space who call >> xfs_log_move_tail call it with param 1 which doesn't modify >> l_tail_lsn) >> I would have thought update_ail and delete_ail would cover the >> changes to the ail and hence what the new min item in the ail list >> is and hence the change in the tail. > > Right - the tail gets moved by (re)moving the tail object in the AIL > >> In the case of an empty AIL, I guess it needs to use l_last_sync_lsn >> which is what xlog_assign_tail_lsn gives you that xfs_log_move_tail >> doesn't. > > No, if a value of zero is passed to xfs_log_move_tail(), the lsn is > grabbed from l_last_sync_lsn, so when we remove the last object from > the AIL from xfs_trans_delete_ail() we set the l_tail_lsn to l_last_sync_lsn, > same as xlog_assign_tail_lsn does. > Yep, sorry missed that bit (we do the same in both). > IOWs, xlog_assign_tail_lsn() could really be considered redundant as > the I/O completion keeps the l_tail_lsn up to date via the AIL manipulation > functions. I decided to split the difference and ensure that what is > written to the iclog does not change by calling it just before the > tail lsn is written into the header.... > > IOWs, I don't think calling xlog_assign_tail_lsn() in > xlog_state_release_iclog() ever changes the l_tail_lsn because > it is always kept up to date via the notifications in the AIL > code..... > Exactly. When looking, I just couldn't see what calling xlog_assign_tail_lsn() is going to do for us considering every time we change the AIL (from metadata io completions etc) we update the l_tail_lsn immediately. Which led me to look at what differences there could be (and found a wrong difference ;-). So do we really need to call xlog_assign_tail_lsn() then? Or are we just being conservative in case we missed something? --Tim From owner-xfs@oss.sgi.com Thu Jan 24 23:07:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jan 2008 23:08:07 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0P77qZs000898 for ; Thu, 24 Jan 2008 23:07:57 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA21822; Fri, 25 Jan 2008 18:08:04 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0P782LF38215055; Fri, 25 Jan 2008 18:08:03 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0P780ko38210787; Fri, 25 Jan 2008 18:08:00 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Fri, 25 Jan 2008 18:08:00 +1100 From: David Chinner To: "Josef 'Jeff' Sipek" Cc: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH 1/1] XFS: Replace custom AIL linked-list code with struct list_head Message-ID: <20080125070800.GH155407@sgi.com> References: <1200875757-26598-1-git-send-email-jeffpc@josefsipek.net> <20080121040422.GA25541@infradead.org> <20080121040740.GA14938@josefsipek.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080121040740.GA14938@josefsipek.net> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5548/Thu Jan 24 19:46:51 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14283 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Sun, Jan 20, 2008 at 11:07:40PM -0500, Josef 'Jeff' Sipek wrote: > On Mon, Jan 21, 2008 at 04:04:23AM +0000, Christoph Hellwig wrote: > > On Sun, Jan 20, 2008 at 07:35:57PM -0500, Josef 'Jeff' Sipek wrote: > > > Signed-off-by: Josef 'Jeff' Sipek > > > --- > > > > > > I tested it with xfsqa, and things work as well as they do without it. > > > > I like this a lot, but I think Dave has plans to replace the linked list > > with a more efficient data structure soon, so it might not actually be > > worth applying. > > I've spoken with him about this, and he wants to have a tree where the > leaves have linked lists (if I understood correctly). So this just makes it > easier/cleaner for him. Sort of. Few things that really should be done in this first patch. Rather than passing listheads to the xfs_ail_*() functions, it should really be changed to pass the xfs_ail_t to those functions. The structure of the list should be opaque to everything outside these functions. It also needs to build with XFS_DEBUG enabled - that means xfs_ail_check needs updating, but I've already got a patch for the other bit (xfsidbg.c) that works which is attached below. Cheers, Dave. --- make xfsidbg.c compile and work with listhead based AIL. Signed-off-by: Dave Chinner --- fs/xfs/xfsidbg.c | 66 +++++++++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 36 deletions(-) Index: 2.6.x-xfs-new/fs/xfs/xfsidbg.c =================================================================== --- 2.6.x-xfs-new.orig/fs/xfs/xfsidbg.c 2008-01-21 16:23:35.000000000 +1100 +++ 2.6.x-xfs-new/fs/xfs/xfsidbg.c 2008-01-21 18:16:11.450796254 +1100 @@ -6167,7 +6167,7 @@ xfsidbg_xlogitem(xfs_log_item_t *lip) printflags((uint)(lip->li_flags), li_flags,"log"); kdb_printf("\n"); kdb_printf("ail forw 0x%p ail back 0x%p lsn %s\ndesc %p ops 0x%p", - lip->li_ail.ail_forw, lip->li_ail.ail_back, + lip->li_ail.next, lip->li_ail.next, xfs_fmtlsn(&(lip->li_lsn)), lip->li_desc, lip->li_ops); kdb_printf(" iodonefunc &0x%p\n", lip->li_cb); if (lip->li_type == XFS_LI_BUF) { @@ -6220,45 +6220,39 @@ xfsidbg_xaildump(xfs_mount_t *mp) }; int count; - if ((mp->m_ail.xa_ail.ail_forw == NULL) || - (mp->m_ail.xa_ail.ail_forw == (xfs_log_item_t *)&mp->m_ail.xa_ail)) { + if (list_empty(&mp->m_ail.xa_ail)) { kdb_printf("AIL is empty\n"); return; } kdb_printf("AIL for mp 0x%p, oldest first\n", mp); - lip = (xfs_log_item_t*)mp->m_ail.xa_ail.ail_forw; - for (count = 0; lip; count++) { - kdb_printf("[%d] type %s ", count, xfsidbg_item_type_str(lip)); - printflags((uint)(lip->li_flags), li_flags, "flags:"); - kdb_printf(" lsn %s\n ", xfs_fmtlsn(&(lip->li_lsn))); - switch (lip->li_type) { - case XFS_LI_BUF: - xfs_buf_item_print((xfs_buf_log_item_t *)lip, 1); - break; - case XFS_LI_INODE: - xfs_inode_item_print((xfs_inode_log_item_t *)lip, 1); - break; - case XFS_LI_EFI: - xfs_efi_item_print((xfs_efi_log_item_t *)lip, 1); - break; - case XFS_LI_EFD: - xfs_efd_item_print((xfs_efd_log_item_t *)lip, 1); - break; - case XFS_LI_DQUOT: - xfs_dquot_item_print((xfs_dq_logitem_t *)lip, 1); - break; - case XFS_LI_QUOTAOFF: - xfs_qoff_item_print((xfs_qoff_logitem_t *)lip, 1); - break; - default: - kdb_printf("Unknown item type %d\n", lip->li_type); - break; - } - - if (lip->li_ail.ail_forw == (xfs_log_item_t*)&mp->m_ail.xa_ail) { - lip = NULL; - } else { - lip = lip->li_ail.ail_forw; + list_for_each_entry(lip, &mp->m_ail.xa_ail, li_ail) { + for (count = 0; lip; count++) { + kdb_printf("[%d] type %s ", count, xfsidbg_item_type_str(lip)); + printflags((uint)(lip->li_flags), li_flags, "flags:"); + kdb_printf(" lsn %s\n ", xfs_fmtlsn(&(lip->li_lsn))); + switch (lip->li_type) { + case XFS_LI_BUF: + xfs_buf_item_print((xfs_buf_log_item_t *)lip, 1); + break; + case XFS_LI_INODE: + xfs_inode_item_print((xfs_inode_log_item_t *)lip, 1); + break; + case XFS_LI_EFI: + xfs_efi_item_print((xfs_efi_log_item_t *)lip, 1); + break; + case XFS_LI_EFD: + xfs_efd_item_print((xfs_efd_log_item_t *)lip, 1); + break; + case XFS_LI_DQUOT: + xfs_dquot_item_print((xfs_dq_logitem_t *)lip, 1); + break; + case XFS_LI_QUOTAOFF: + xfs_qoff_item_print((xfs_qoff_logitem_t *)lip, 1); + break; + default: + kdb_printf("Unknown item type %d\n", lip->li_type); + break; + } } } } From owner-xfs@oss.sgi.com Thu Jan 24 23:16:23 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jan 2008 23:16:25 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: ** X-Spam-Status: No, score=2.8 required=5.0 tests=BAYES_50,RCVD_BAD_ID autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0P7GKim001905 for ; Thu, 24 Jan 2008 23:16:23 -0800 X-ASG-Debug-ID: 1201245395-0c1501210000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from m12-13.163.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id E2A8155C04C for ; Thu, 24 Jan 2008 23:16:36 -0800 (PST) Received: from m12-13.163.com (m12-13.163.com [220.181.12.13]) by cuda.sgi.com with SMTP id lWwzrAQYQCnuCmmP for ; Thu, 24 Jan 2008 23:16:36 -0800 (PST) Received: from luoxiaohua (unknown [60.191.58.178]) by smtp9 (Coremail) with SMTP id DcCowLD7zwnOjJlHWqmkAA==.28840S2; Fri, 25 Jan 2008 15:16:32 +0800 (CST) Date: Fri, 25 Jan 2008 15:16:36 +0800 From: "lxh" Reply-To: lxhzju@163.com To: "xfs" X-ASG-Orig-Subj: kernel oops on debian, 2.6.18-5, large xfs volume Subject: kernel oops on debian, 2.6.18-5, large xfs volume Message-ID: <200801251516352343935@163.com> X-mailer: Foxmail 6, 10, 201, 22 [cn] Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" X-Coremail-Antispam: 1Uf129KBjvJXoW7WFWfXrW8Jw48uw43Zr15twb_yoW8CrW5pr W7Jr4UGr40yryDAr4jvay5tF18Xr1jya4xCry8JF1rZa15Gw1UZF4SyF4jkF1DJw45AFy3 XrWDtF4UW345AwUanT9S1TB71UUUUUUv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjpI5I 8CrVACY4xI64kE6c02F40Ex7xfM7AC8VAFwI0_Jr0_Gr1l1I0E4x80FVCIwcAKzIAtM7C2 6IkvcIIF6IxKo4kEV4yl1IIY67AEw4v_Jr0_Jr4lYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx 0Ex4A2jsIE14v26r1j6r4UM4xvF2IEb7IF0Fy264kE64k0F24lFcxC0VAYjxAxZF0Ex2Iq xwCjxxvEw4Wlc2IjII80xcxEwVWxJVW3JwCF72vE52k0Y41lx4CE17CEb7AF67AKxVWUJV WUXwCE64xvF2IEb7IF0Fy7M7k0a2IF6r1UM7kC6x804xJvcSsGvfC2KfnxnUUI43ZEXa7x Ru2NtUUUUUU== X-Barracuda-Connect: m12-13.163.com[220.181.12.13] X-Barracuda-Start-Time: 1201245400 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.00 X-Barracuda-Spam-Status: No, SCORE=-1.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=BSF_RULE7568M, MIME_BASE64_TEXT X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40431 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M BODY: Custom Rule 7568M 0.52 MIME_BASE64_TEXT RAW: Message text disguised using base64 encoding X-Virus-Scanned: ClamAV 0.91.2/5550/Thu Jan 24 23:02:45 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by oss.sgi.com id m0P7GNim001915 X-archive-position: 14284 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lxhzju@163.com Precedence: bulk X-list: xfs Hello, we have dozens of file servers with a 1.5TB/2.5 TB large xfs file system volume running on a RAID6 SATA array. Each volume contains about 10,000,000 files. The Operating system is debian GNU/Linux 2.6.18-5-amd64 #1 SMP. we got a kernel oops frequently last year. here is the oops : Filesystem "cciss/c0d1": XFS internal error xfs_trans_cancel at line 1138 of file fs/xfs/xfs_trans.c. Caller 0xffffffff881df006 Call Trace: [] :xfs:xfs_trans_cancel+0x5b/0xfe [] :xfs:xfs_create+0x58b/0x5dd [] :xfs:xfs_vn_mknod+0x1bd/0x3c8 [] default_wake_function+0x0/0xe [] __up_read+0x13/0x8a [] :xfs:xfs_iunlock+0x57/0x79 [] :xfs:xfs_lookup+0x6c/0x7d [] __up_read+0x13/0x8a [] :xfs:xfs_iunlock+0x57/0x79 [] :xfs:xfs_access+0x3d/0x46 [] :xfs:xfs_vn_permission+0x14/0x18 [] permission+0x87/0xce [] __link_path_walk+0x16a/0xf3c [] mntput_no_expire+0x19/0x8b [] link_path_walk+0xd3/0xe5 [] vfs_create+0xe7/0x12c [] open_namei+0x18d/0x69c [] do_filp_open+0x1c/0x3d [] do_sys_open+0x44/0xc5 [] system_call+0x7e/0x83 ¡¡¡¡ Every time the error occurs, the volume can not be accessed. So we have to umount this volume, run xfs_repair, and then remount it. This problem causes seriously impact of our service. Could you help me resolve this problem ? ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Luo xiaohua ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡lxhzju@163.com ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2008-01-25 From owner-xfs@oss.sgi.com Thu Jan 24 23:39:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jan 2008 23:39:07 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0P7d1bG003349 for ; Thu, 24 Jan 2008 23:39:03 -0800 X-ASG-Debug-ID: 1201246759-471601510000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from filer.fsl.cs.sunysb.edu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3B697CF7E25; Thu, 24 Jan 2008 23:39:19 -0800 (PST) Received: from filer.fsl.cs.sunysb.edu (filer.fsl.cs.sunysb.edu [130.245.126.2]) by cuda.sgi.com with ESMTP id Mv9LAUjIQn9NupYP; Thu, 24 Jan 2008 23:39:19 -0800 (PST) Received: from josefsipek.net (baal.fsl.cs.sunysb.edu [130.245.126.78]) by filer.fsl.cs.sunysb.edu (8.12.11.20060308/8.13.1) with ESMTP id m0P7aaNu029012; Fri, 25 Jan 2008 02:36:38 -0500 Received: by josefsipek.net (Postfix, from userid 1000) id DFDCB1C00DD2; Fri, 25 Jan 2008 02:36:38 -0500 (EST) Date: Fri, 25 Jan 2008 02:36:38 -0500 From: "Josef 'Jeff' Sipek" To: David Chinner Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/1] XFS: Replace custom AIL linked-list code with struct list_head Subject: Re: [PATCH 1/1] XFS: Replace custom AIL linked-list code with struct list_head Message-ID: <20080125073638.GA24521@josefsipek.net> References: <1200875757-26598-1-git-send-email-jeffpc@josefsipek.net> <20080121040422.GA25541@infradead.org> <20080121040740.GA14938@josefsipek.net> <20080125070800.GH155407@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080125070800.GH155407@sgi.com> User-Agent: Mutt/1.5.16 (2007-06-11) X-Barracuda-Connect: filer.fsl.cs.sunysb.edu[130.245.126.2] X-Barracuda-Start-Time: 1201246762 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40433 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5550/Thu Jan 24 23:02:45 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14285 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jeffpc@josefsipek.net Precedence: bulk X-list: xfs On Fri, Jan 25, 2008 at 06:08:00PM +1100, David Chinner wrote: ... > Few things that really should be done in this first patch. Rather > than passing listheads to the xfs_ail_*() functions, it should > really be changed to pass the xfs_ail_t to those functions. The > structure of the list should be opaque to everything outside these > functions. Agreed. I'm going to send a fixed up version of the patch sometime tomorrow. > It also needs to build with XFS_DEBUG enabled - that means > xfs_ail_check needs updating, but I've already got a patch > for the other bit (xfsidbg.c) that works which is attached below. Lesson learned...compile with XFS_DEBUG on. Josef 'Jeff' Sipek. -- Real Programmers consider "what you see is what you get" to be just as bad a concept in Text Editors as it is in women. No, the Real Programmer wants a "you asked for it, you got it" text editor -- complicated, cryptic, powerful, unforgiving, dangerous. From owner-xfs@oss.sgi.com Thu Jan 24 23:42:23 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jan 2008 23:42:29 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0P7gHQl003806 for ; Thu, 24 Jan 2008 23:42:22 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA23686; Fri, 25 Jan 2008 18:42:37 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0P7gaLF37662852; Fri, 25 Jan 2008 18:42:36 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0P7gZR438228552; Fri, 25 Jan 2008 18:42:35 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Fri, 25 Jan 2008 18:42:35 +1100 From: David Chinner To: Timothy Shimmin Cc: David Chinner , xfs-dev , xfs-oss Subject: Re: [patch] Prevent AIL lock contention during transaction completion Message-ID: <20080125074235.GI155407@sgi.com> References: <20080121052330.GG155259@sgi.com> <4796E8C8.3030702@sgi.com> <20080123073446.GU155259@sgi.com> <479986F5.7070800@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <479986F5.7070800@sgi.com> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5550/Thu Jan 24 23:02:45 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14286 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Fri, Jan 25, 2008 at 05:51:33PM +1100, Timothy Shimmin wrote: > So do we really need to call xlog_assign_tail_lsn() then? > Or are we just being conservative in case we missed something? Conservative - the last thing I want is to introduce a subtle difference to the tail lsn in the log record because we didn't update it immediately before writing it to disk. I think we are probably safe removing it, but lets leave that until we got some wider test coverage on this change first.... Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Fri Jan 25 00:01:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 25 Jan 2008 00:01:31 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m0P81NhA007063 for ; Fri, 25 Jan 2008 00:01:27 -0800 Received: from snort.melbourne.sgi.com (snort.melbourne.sgi.com [134.14.54.149]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id TAA24794; Fri, 25 Jan 2008 19:01:39 +1100 Received: from snort.melbourne.sgi.com (localhost [127.0.0.1]) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m0P81bLF38213092; Fri, 25 Jan 2008 19:01:38 +1100 (AEDT) Received: (from dgc@localhost) by snort.melbourne.sgi.com (SGI-8.12.5/8.12.5/Submit) id m0P81Ysa38239002; Fri, 25 Jan 2008 19:01:34 +1100 (AEDT) X-Authentication-Warning: snort.melbourne.sgi.com: dgc set sender to dgc@sgi.com using -f Date: Fri, 25 Jan 2008 19:01:34 +1100 From: David Chinner To: lxh Cc: xfs Subject: Re: kernel oops on debian, 2.6.18-5, large xfs volume Message-ID: <20080125080134.GJ155407@sgi.com> References: <200801251516352343935@163.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200801251516352343935@163.com> User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: ClamAV 0.91.2/5550/Thu Jan 24 23:02:45 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14287 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dgc@sgi.com Precedence: bulk X-list: xfs On Fri, Jan 25, 2008 at 03:16:36PM +0800, lxh wrote: > Hello, > we have dozens of file servers with a 1.5TB/2.5 TB large xfs file system > volume running on a RAID6 SATA array. Each volume contains about > 10,000,000 files. The Operating system is debian GNU/Linux 2.6.18-5-amd64 > #1 SMP. we got a kernel oops frequently last year. > > here is the oops : > Filesystem "cciss/c0d1": XFS internal error xfs_trans_cancel at line 1138 > of file fs/xfs/xfs_trans.c. Caller 0xffffffff881df006 > Call Trace: > [] :xfs:xfs_trans_cancel+0x5b/0xfe > [] :xfs:xfs_create+0x58b/0x5dd > [] :xfs:xfs_vn_mknod+0x1bd/0x3c8 Are you running out of space in the filesystem? The only vectors I've seen that can cause this are I/O errors or ENOSPC during file create after we've already checked that this cannot happen. Are there any I/O errors in the log? This commit: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=45c34141126a89da07197d5b89c04c6847f1171a which is in 2.6.23 fixed the last known cause of the ENOSPC issue, so upgrading the kernel or patching this fix back to the 2.6.18 kernel may fix the problem if it is related to ENOSPC. > Every time the error occurs, the volume can not be accessed. So we have to > umount this volume, run xfs_repair, and then remount it. This problem > causes seriously impact of our service. Anyway, next time it happens, can you please run xfs_check on the filesystem first and post the output? If there is no output, then the filesystem is fine and you don't need to run repair. If it is not fine, can also post the output of xfs_repair? Once the filesystem has been fixed up, can you then post the output of this command to tell us the space usage in the filesystems? # xfs_db -r -c 'sb 0' -c p Cheers, Dave. -- Dave Chinner Principal Engineer SGI Australian Software Group From owner-xfs@oss.sgi.com Fri Jan 25 01:41:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 25 Jan 2008 01:41:15 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: ** X-Spam-Status: No, score=2.8 required=5.0 tests=BAYES_50,RCVD_BAD_ID autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0P9f5AZ018512 for ; Fri, 25 Jan 2008 01:41:10 -0800 X-ASG-Debug-ID: 1201254079-2eb000020000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from m12-13.163.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 49058361BEC for ; Fri, 25 Jan 2008 01:41:23 -0800 (PST) Received: from m12-13.163.com (m12-13.163.com [220.181.12.13]) by cuda.sgi.com with SMTP id bRhKA6H8QcP5jxPP for ; Fri, 25 Jan 2008 01:41:23 -0800 (PST) Received: from luoxiaohua (unknown [60.191.58.178]) by smtp9 (Coremail) with SMTP id DcCowLDLrAusrplHAsWyAA==.48859S2; Fri, 25 Jan 2008 17:41:02 +0800 (CST) Date: Fri, 25 Jan 2008 17:41:05 +0800 From: "lxh" Reply-To: lxhzju@163.com To: "xfs" X-ASG-Orig-Subj: Re: Re: kernel oops on debian, 2.6.18-5, large xfs volume Subject: Re: Re: kernel oops on debian, 2.6.18-5, large xfs volume Message-ID: <200801251741035934497@163.com> X-mailer: Foxmail 6, 10, 201, 22 [cn] Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" X-Coremail-Antispam: 1Uf129KBjvJXoWxCrWfJrW7Gr1DtF1fCw15urg_yoW5WFyDpF ZFyr4Ikr4DtFy8twn293yjqa43Zw40yaySqry8G3Z2ywn8WrnFvF4xKFWY9a4DKw4xCw43 tF47KrWUK348A3JanT9S1TB71UUUUU7v73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UU Unkc02F40EFcxC0VAKzVAqx4xG6I80ewAFF20E14v26r1j6r4UM7C26xCjj4IEI4klw4CS wwAFxVCaYxvI4VCIwcAKzIAtM7CIcVAFz4kK6r1j6r18M2kK6IIYrVAqxI0j4VAqrcv_Jw 1UGr1DMcIj64x0Y40En7xvr7AKxVW8JVWxJwAv7VC0I7IYx2IY67AKxVWUGVWUXwAv7VC2 z280aVAFwI0_Gr0_Cr1lFcxC0VAYjxAxZF0Ew4CEw7xC0wACY4xI67k04243AVC20s07Mx 02cVAKzwCY02Avz4vE14v_GFWlc2IjII80xcxEwVWxJVW3JwCF72vE52k0Y41l4IxYO2xF xVAFwI0_Jrv_JF1lx4CE17CEb7AF67AKxVWUJVWUXwCI42IY6xIIjxv20xvE14v26r1j6r 1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6I8E87Iv67AKxVWUJVW8JwCI 42IY6I8E87Iv6xkF7I0E14v26r1j6r4UMVCEFcxC0VAYjxAxZF1lb7Iv0xC_Cr1lb4IE77 IF4bIYCTnIWIevJa73UjIFyTuYvjxUh18BUUUUU X-Barracuda-Connect: m12-13.163.com[220.181.12.13] X-Barracuda-Start-Time: 1201254085 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.00 X-Barracuda-Spam-Status: No, SCORE=-1.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=BSF_RULE7568M, MIME_BASE64_TEXT X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40439 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M BODY: Custom Rule 7568M 0.52 MIME_BASE64_TEXT RAW: Message text disguised using base64 encoding X-Virus-Scanned: ClamAV 0.91.2/5550/Thu Jan 24 23:02:45 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by oss.sgi.com id m0P9fAAZ018519 X-archive-position: 14288 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lxhzju@163.com Precedence: bulk X-list: xfs Hi, ======= 2008-01-25 16:01:54 ======= >On Fri, Jan 25, 2008 at 03:16:36PM +0800, lxh wrote: >> Hello, >> we have dozens of file servers with a 1.5TB/2.5 TB large xfs file system >> volume running on a RAID6 SATA array. Each volume contains about >> 10,000,000 files. The Operating system is debian GNU/Linux 2.6.18-5-amd64 >> #1 SMP. we got a kernel oops frequently last year. >> >> here is the oops : >> Filesystem "cciss/c0d1": XFS internal error xfs_trans_cancel at line 1138 >> of file fs/xfs/xfs_trans.c. Caller 0xffffffff881df006 >> Call Trace: >> [] :xfs:xfs_trans_cancel+0x5b/0xfe >> [] :xfs:xfs_create+0x58b/0x5dd >> [] :xfs:xfs_vn_mknod+0x1bd/0x3c8 > >Are you running out of space in the filesystem? we did not run out of space. there is enough space for writing. > >The only vectors I've seen that can cause this are I/O errors >or ENOSPC during file create after we've already checked that >this cannot happen. Are there any I/O errors in the log? > After we run xfs_repair, it outputs nothing special. I guess this problem be related with big volume and a mass of small files. Some servers are equipped with same hardware and software, but they are configured with 1TB volume and stored big files. This problem never happen on them. >This commit: > >http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=45c34141126a89da07197d5b89c04c6847f1171a > >which is in 2.6.23 fixed the last known cause of the ENOSPC >issue, so upgrading the kernel or patching this fix back >to the 2.6.18 kernel may fix the problem if it is related to >ENOSPC. Thank you very much for your help! I will try this patch on some machines. > >> Every time the error occurs, the volume can not be accessed. So we have to >> umount this volume, run xfs_repair, and then remount it. This problem >> causes seriously impact of our service. > >Anyway, next time it happens, can you please run xfs_check on the >filesystem first and post the output? If there is no output, then >the filesystem is fine and you don't need to run repair. The volume is unusable when it happens. So we run xfs_repair. The xfs_repair operation output nothing special. But after xfs_repair, we can access the volume again. I don't konw why. > >If it is not fine, can also post the output of xfs_repair? > >Once the filesystem has been fixed up, can you then post the >output of this command to tell us the space usage in the filesystems? > ># xfs_db -r -c 'sb 0' -c p I will comply with the your suggestions when it happens again, and then contact you. > >Cheers, > >Dave. >-- >Dave Chinner >Principal Engineer >SGI Australian Software Group = = = = = = = = = = = = = = = = = = = = Cheers, Luoxiaohua NetEase.com Inc ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡lxhzju@163.com ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2008-01-25 From owner-xfs@oss.sgi.com Sun Jan 27 23:21:32 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 27 Jan 2008 23:21:42 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.1 required=5.0 tests=BAYES_50,HTML_MESSAGE, J_CHICKENPOX_45,T_STOX_BOUND_090909_B autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0S7LRKM003413 for ; Sun, 27 Jan 2008 23:21:32 -0800 X-ASG-Debug-ID: 1201504903-667b01830000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from elasmtp-galgo.atl.sa.earthlink.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 66062D1410D; Sun, 27 Jan 2008 23:21:44 -0800 (PST) Received: from elasmtp-galgo.atl.sa.earthlink.net (elasmtp-galgo.atl.sa.earthlink.net [209.86.89.61]) by cuda.sgi.com with ESMTP id fw2wYpH4aeowZZCL; Sun, 27 Jan 2008 23:21:44 -0800 (PST) Received: from [64.131.226.230] (helo=[192.168.0.150]) by elasmtp-galgo.atl.sa.earthlink.net with asmtp (TLSv1:AES256-SHA:256) (Exim 4.34) id 1JJOJE-0007vA-Rr; Mon, 28 Jan 2008 02:21:38 -0500 Message-ID: <479D825F.5060305@mpigani.org> Date: Mon, 28 Jan 2008 02:21:03 -0500 From: Dragos User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: linux-raid@vger.kernel.org, xfs@oss.sgi.com CC: David Greaves , mjt@tls.msk.ru, sandeen@sandeen.net, dgc@sgi.com X-ASG-Orig-Subj: Re: assemble vs create an array....... Subject: Re: assemble vs create an array....... Content-Type: multipart/mixed; boundary="------------050705000404000303010802" X-ELNK-Trace: 382be18c4f3f7bcad780f4a490ca6956abb457f1b4332f5203330f9c88d3a4bf3604c01ac7823455350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 64.131.226.230 X-Barracuda-Connect: elasmtp-galgo.atl.sa.earthlink.net[209.86.89.61] X-Barracuda-Start-Time: 1201504905 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.89 X-Barracuda-Spam-Status: No, SCORE=-1.89 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=HTML_MESSAGE, HTML_TAG_EXIST_TBODY X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40664 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.13 HTML_TAG_EXIST_TBODY BODY: HTML has "tbody" tag 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/5574/Sun Jan 27 02:03:42 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14289 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dragos@mpigani.org Precedence: bulk X-list: xfs This is a multi-part message in MIME format. --------------050705000404000303010802 Content-Type: multipart/alternative; boundary="------------040600020304090402010209" --------------040600020304090402010209 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hello, Have a Happy New and Prosperous Year. First of all, thank you again for all your previous answers. The last message I received regarding my issue was on 12.06 so I should refresh your memories. I passed a --create option instead of --assemble on top of an existing raid 5 array formatted with xfs. I followed your advice and here is a table of my results so far. I also attached the results of the first combination (w/ -c128 option). A quick diff on the 3 combinations with the least number of errors (abm, amc, mbc) showed few differences. Do you need to see the other reports? At this point it seems that doing a xfs_repair on the first combination would be ok. What do you think? Are there any options I should pass to xfs_repair to increase my chances? I hope you can continue to enlighten me with your knowledge and experience. Thank you in advance for your time and help, Dragos mdadm --create /dev/md0 --raid-devices=3 --level=5 /dev/sda1 /dev/sdb1 missing --------- without and with --chunk=128 mount /dev/md0 t xfs_repair -n /dev/md0 2> xfs_repair-abm.txt mdadm --stop /dev/md0 *combination* *mount response* *xfs_repair: **size of report file & tty output w/o & w/ -c128* a b m structure needs cleaning 7.9Mb No modify flag set, skipping phase 5 56.2kb No modify flag set, skipping phase 5 a m b structure needs cleaning 4.9Mb No modify flag set, skipping phase 5 1.9Gb No modify flag set, skipping phase 5 m a b you must specify the filesystem type a c m structure needs cleaning 4.9Mb nothing 1.9Gb No modify flag set, skipping phase 5 a m c structure needs cleaning 7.9Mb No modify flag set, skipping phase 5 56.2kb No modify flag set, skipping phase 5 m a c you must specify the filesystem type b c m you must specify the filesystem type b m c you must specify the filesystem type m b c structure needs cleaning 7.9Mb No modify flag set, skipping phase 5 56.2kb No modify flag set, skipping phase 5 b a m you must specify the filesystem type b m a you must specify the filesystem type m b a you must specify the filesystem type c a m you must specify the filesystem type c m a you must specify the filesystem type m c a you must specify the filesystem type c b m you must specify the filesystem type c m b you must specify the filesystem type m c b structure needs cleaning 4.9Mb No modify flag set, skipping phase 5 1.9Gb No modify flag set, skipping phase 5 --------------040600020304090402010209 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hello,
Have a Happy New and Prosperous Year.

First of all, thank you again for all your previous answers.

The last message I received regarding my issue was on 12.06 so I should refresh your memories. I passed a --create option instead of --assemble on top of an existing  raid 5 array formatted with xfs.

I followed your advice and here is a table of my results so far. I also attached the results of the first combination (w/ -c128 option). A quick diff on the 3 combinations with the least number of errors (abm, amc, mbc) showed few differences. Do you need to see the other reports?

At this point it seems that doing a xfs_repair on the first combination would be ok. What do you think? Are there any options I should pass to xfs_repair to increase my chances?

I hope you can continue to enlighten me with your knowledge and experience.

Thank you in advance for your time and help,
Dragos


mdadm --create /dev/md0 --raid-devices=3 --level=5 /dev/sda1 /dev/sdb1 missing

--------- without and with –chunk=128

mount /dev/md0 t

xfs_repair -n /dev/md0 2> xfs_repair-abm.txt

mdadm –stop /dev/md0

combination

mount response

xfs_repair: size of report file & tty output w/o & w/ -c128

a b m

structure needs cleaning

7.9Mb

No modify flag set, skipping phase 5

56.2kb

No modify flag set, skipping phase 5

a m b

structure needs cleaning

4.9Mb

No modify flag set, skipping phase 5

1.9Gb

No modify flag set, skipping phase 5

m a b

you must specify the filesystem type


a c m

structure needs cleaning

4.9Mb

nothing

1.9Gb

No modify flag set, skipping phase 5

a m c

structure needs cleaning

7.9Mb

No modify flag set, skipping phase 5

56.2kb

No modify flag set, skipping phase 5

m a c

you must specify the filesystem type


b c m

you must specify the filesystem type


b m c

you must specify the filesystem type


m b c

structure needs cleaning

7.9Mb

No modify flag set, skipping phase 5

56.2kb

No modify flag set, skipping phase 5

b a m

you must specify the filesystem type


b m a

you must specify the filesystem type


m b a

you must specify the filesystem type


c a m

you must specify the filesystem type


c m a

you must specify the filesystem type


m c a

you must specify the filesystem type


c b m

you must specify the filesystem type


c m b

you must specify the filesystem type


m c b

structure needs cleaning

4.9Mb

No modify flag set, skipping phase 5

1.9Gb

No modify flag set, skipping phase 5

--------------040600020304090402010209-- --------------050705000404000303010802 Content-Type: text/plain; name="xfs_repair-abm-128.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xfs_repair-abm-128.txt" - creating 4 worker thread(s) Phase 1 - find and verify superblock... - reporting progress in intervals of 15 minutes Phase 2 - using internal log - scan filesystem freespace and inode maps... - 16:11:50: scanning filesystem freespace - 16 of 16 allocation groups done - found root inode chunk Phase 3 - for each AG... - scan (but don't clear) agi unlinked lists... - 16:11:50: scanning agi unlinked lists - 16 of 16 allocation groups done - 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 bad magic number 0xfeed on inode 1074266624 bad version number 0x0 on inode 1074266624 bad inode format in inode 1074266624 bad magic number 0x0 on inode 1074266625 bad version number 0x0 on inode 1074266625 bad (negative) size -7746721568139339722 on inode 1074266625 bad magic number 0xfeed on inode 1074266626 bad version number 0x0 on inode 1074266626 bad inode format in inode 1074266626 bad magic number 0x0 on inode 1074266627 bad version number 0x0 on inode 1074266627 bad (negative) size -7746721568139339722 on inode 1074266627 bad magic number 0xfeed on inode 1074266628 bad version number 0x0 on inode 1074266628 bad inode format in inode 1074266628 bad magic number 0x0 on inode 1074266629 bad version number 0x0 on inode 1074266629 bad (negative) size -7746721568139339722 on inode 1074266629 bad magic number 0xfeed on inode 1074266630 bad version number 0x0 on inode 1074266630 bad inode format in inode 1074266630 bad magic number 0x0 on inode 1074266631 bad version number 0x0 on inode 1074266631 bad (negative) size -7746721568139339722 on inode 1074266631 bad magic number 0xfeed on inode 1074266632 bad version number 0x0 on inode 1074266632 bad inode format in inode 1074266632 bad magic number 0x0 on inode 1074266633 bad version number 0x0 on inode 1074266633 bad (negative) size -7746721568139339722 on inode 1074266633 bad magic number 0xfeed on inode 1074266634 bad version number 0x0 on inode 1074266634 bad inode format in inode 1074266634 bad magic number 0x0 on inode 1074266635 bad version number 0x0 on inode 1074266635 bad (negative) size -7746721568139339722 on inode 1074266635 bad magic number 0xfeed on inode 1074266636 bad version number 0x0 on inode 1074266636 bad inode format in inode 1074266636 bad magic number 0x0 on inode 1074266637 bad version number 0x0 on inode 1074266637 bad (negative) size -7746721568139339722 on inode 1074266637 bad magic number 0xfeed on inode 1074266638 bad version number 0x0 on inode 1074266638 bad inode format in inode 1074266638 bad magic number 0x0 on inode 1074266639 bad version number 0x0 on inode 1074266639 bad (negative) size -7746721568139339722 on inode 1074266639 bad magic number 0xfeed on inode 1074266640 bad version number 0x0 on inode 1074266640 bad inode format in inode 1074266640 bad magic number 0x0 on inode 1074266641 bad version number 0x0 on inode 1074266641 bad (negative) size -7746721568139339722 on inode 1074266641 bad magic number 0xfeed on inode 1074266642 bad version number 0x0 on inode 1074266642 bad inode format in inode 1074266642 bad magic number 0x0 on inode 1074266643 bad version number 0x0 on inode 1074266643 bad (negative) size -7746721568139339722 on inode 1074266643 bad magic number 0xfeed on inode 1074266644 bad version number 0x0 on inode 1074266644 bad inode format in inode 1074266644 bad magic number 0x0 on inode 1074266645 bad version number 0x0 on inode 1074266645 bad (negative) size -7746721568139339722 on inode 1074266645 bad magic number 0xfeed on inode 1074266646 bad version number 0x0 on inode 1074266646 bad inode format in inode 1074266646 bad magic number 0x0 on inode 1074266647 bad version number 0x0 on inode 1074266647 bad (negative) size -7746721568139339722 on inode 1074266647 bad magic number 0xfeed on inode 1074266648 bad version number 0x0 on inode 1074266648 bad inode format in inode 1074266648 bad magic number 0x0 on inode 1074266649 bad version number 0x0 on inode 1074266649 bad (negative) size -7746721568139339722 on inode 1074266649 bad magic number 0xfeed on inode 1074266650 bad version number 0x0 on inode 1074266650 bad inode format in inode 1074266650 bad magic number 0x0 on inode 1074266651 bad version number 0x0 on inode 1074266651 bad (negative) size -7746721568139339722 on inode 1074266651 bad magic number 0xfeed on inode 1074266652 bad version number 0x0 on inode 1074266652 bad inode format in inode 1074266652 bad magic number 0x0 on inode 1074266653 bad version number 0x0 on inode 1074266653 bad (negative) size -7746721568139339722 on inode 1074266653 bad magic number 0xfeed on inode 1074266654 bad version number 0x0 on inode 1074266654 bad inode format in inode 1074266654 bad magic number 0x0 on inode 1074266655 bad version number 0x0 on inode 1074266655 bad (negative) size -7746721568139339722 on inode 1074266655 bad magic number 0xfeed on inode 1074266656 bad version number 0x0 on inode 1074266656 bad inode format in inode 1074266656 bad magic number 0x0 on inode 1074266657 bad version number 0x0 on inode 1074266657 bad (negative) size -7746721568139339722 on inode 1074266657 bad magic number 0xfeed on inode 1074266658 bad version number 0x0 on inode 1074266658 bad inode format in inode 1074266658 bad magic number 0x0 on inode 1074266659 bad version number 0x0 on inode 1074266659 bad (negative) size -7746721568139339722 on inode 1074266659 bad magic number 0xfeed on inode 1074266660 bad version number 0x0 on inode 1074266660 bad inode format in inode 1074266660 bad magic number 0x0 on inode 1074266661 bad version number 0x0 on inode 1074266661 bad (negative) size -7746721568139339722 on inode 1074266661 bad magic number 0xfeed on inode 1074266662 bad version number 0x0 on inode 1074266662 bad inode format in inode 1074266662 bad magic number 0x0 on inode 1074266663 bad version number 0x0 on inode 1074266663 bad (negative) size -7746721568139339722 on inode 1074266663 bad magic number 0xfeed on inode 1074266664 bad version number 0x0 on inode 1074266664 bad inode format in inode 1074266664 bad magic number 0x0 on inode 1074266665 bad version number 0x0 on inode 1074266665 bad (negative) size -7746721568139339722 on inode 1074266665 bad magic number 0xfeed on inode 1074266666 bad version number 0x0 on inode 1074266666 bad inode format in inode 1074266666 bad magic number 0x0 on inode 1074266667 bad version number 0x0 on inode 1074266667 bad (negative) size -7746721568139339722 on inode 1074266667 bad magic number 0xfeed on inode 1074266668 bad version number 0x0 on inode 1074266668 bad inode format in inode 1074266668 bad magic number 0x0 on inode 1074266669 bad version number 0x0 on inode 1074266669 bad (negative) size -7746721568139339722 on inode 1074266669 bad magic number 0xfeed on inode 1074266670 bad version number 0x0 on inode 1074266670 bad inode format in inode 1074266670 bad magic number 0x0 on inode 1074266671 bad version number 0x0 on inode 1074266671 bad (negative) size -7746721568139339722 on inode 1074266671 bad magic number 0xfeed on inode 1074266672 bad version number 0x0 on inode 1074266672 bad inode format in inode 1074266672 bad magic number 0x0 on inode 1074266673 bad version number 0x0 on inode 1074266673 bad (negative) size -7746721568139339722 on inode 1074266673 bad magic number 0xfeed on inode 1074266674 bad version number 0x0 on inode 1074266674 bad inode format in inode 1074266674 bad magic number 0x0 on inode 1074266675 bad version number 0x0 on inode 1074266675 bad (negative) size -7746721568139339722 on inode 1074266675 bad magic number 0xfeed on inode 1074266676 bad version number 0x0 on inode 1074266676 bad inode format in inode 1074266676 bad magic number 0x0 on inode 1074266677 bad version number 0x0 on inode 1074266677 bad (negative) size -7746721568139339722 on inode 1074266677 bad magic number 0xfeed on inode 1074266678 bad version number 0x0 on inode 1074266678 bad inode format in inode 1074266678 bad magic number 0x0 on inode 1074266679 bad version number 0x0 on inode 1074266679 bad (negative) size -7746721568139339722 on inode 1074266679 bad magic number 0xfeed on inode 1074266680 bad version number 0x0 on inode 1074266680 bad inode format in inode 1074266680 bad magic number 0x0 on inode 1074266681 bad version number 0x0 on inode 1074266681 bad (negative) size -7746721568139339722 on inode 1074266681 bad magic number 0xfeed on inode 1074266682 bad version number 0x0 on inode 1074266682 bad inode format in inode 1074266682 bad magic number 0x0 on inode 1074266683 bad version number 0x0 on inode 1074266683 bad (negative) size -7746721568139339722 on inode 1074266683 bad magic number 0xfeed on inode 1074266684 bad version number 0x0 on inode 1074266684 bad inode format in inode 1074266684 bad magic number 0x0 on inode 1074266685 bad version number 0x0 on inode 1074266685 bad (negative) size -7746721568139339722 on inode 1074266685 bad magic number 0xfeed on inode 1074266686 bad version number 0x0 on inode 1074266686 bad inode format in inode 1074266686 bad magic number 0x0 on inode 1074266687 bad version number 0x0 on inode 1074266687 bad (negative) size -7746721568139339722 on inode 1074266687 bad magic number 0xfeed on inode 1074266688 bad version number 0x0 on inode 1074266688 bad inode format in inode 1074266688 bad magic number 0x0 on inode 1074266689 bad version number 0x0 on inode 1074266689 bad (negative) size -7746721568139339722 on inode 1074266689 bad magic number 0xfeed on inode 1074266690 bad version number 0x0 on inode 1074266690 bad inode format in inode 1074266690 bad magic number 0x0 on inode 1074266691 bad version number 0x0 on inode 1074266691 bad (negative) size -7746721568139339722 on inode 1074266691 bad magic number 0xfeed on inode 1074266692 bad version number 0x0 on inode 1074266692 bad inode format in inode 1074266692 bad magic number 0x0 on inode 1074266693 bad version number 0x0 on inode 1074266693 bad (negative) size -7746721568139339722 on inode 1074266693 bad magic number 0xfeed on inode 1074266694 bad version number 0x0 on inode 1074266694 bad inode format in inode 1074266694 bad magic number 0x0 on inode 1074266695 bad version number 0x0 on inode 1074266695 bad (negative) size -7746721568139339722 on inode 1074266695 bad magic number 0xfeed on inode 1074266696 bad version number 0x0 on inode 1074266696 bad inode format in inode 1074266696 bad magic number 0x0 on inode 1074266697 bad version number 0x0 on inode 1074266697 bad (negative) size -7746721568139339722 on inode 1074266697 bad magic number 0xfeed on inode 1074266698 bad version number 0x0 on inode 1074266698 bad inode format in inode 1074266698 bad magic number 0x0 on inode 1074266699 bad version number 0x0 on inode 1074266699 bad (negative) size -7746721568139339722 on inode 1074266699 bad magic number 0xfeed on inode 1074266700 bad version number 0x0 on inode 1074266700 bad inode format in inode 1074266700 bad magic number 0x0 on inode 1074266701 bad version number 0x0 on inode 1074266701 bad (negative) size -7746721568139339722 on inode 1074266701 bad magic number 0xfeed on inode 1074266702 bad version number 0x0 on inode 1074266702 bad inode format in inode 1074266702 bad magic number 0x0 on inode 1074266703 bad version number 0x0 on inode 1074266703 bad (negative) size -7746721568139339722 on inode 1074266703 bad magic number 0xfeed on inode 1074266704 bad version number 0x0 on inode 1074266704 bad inode format in inode 1074266704 bad magic number 0x0 on inode 1074266705 bad version number 0x0 on inode 1074266705 bad (negative) size -7746721568139339722 on inode 1074266705 bad magic number 0xfeed on inode 1074266706 bad version number 0x0 on inode 1074266706 bad inode format in inode 1074266706 bad magic number 0x0 on inode 1074266707 bad version number 0x0 on inode 1074266707 bad (negative) size -7746721568139339722 on inode 1074266707 bad magic number 0xfeed on inode 1074266708 bad version number 0x0 on inode 1074266708 bad inode format in inode 1074266708 bad magic number 0x0 on inode 1074266709 bad version number 0x0 on inode 1074266709 bad (negative) size -7746721568139339722 on inode 1074266709 bad magic number 0xfeed on inode 1074266710 bad version number 0x0 on inode 1074266710 bad inode format in inode 1074266710 bad magic number 0x0 on inode 1074266711 bad version number 0x0 on inode 1074266711 bad (negative) size -7746721568139339722 on inode 1074266711 bad magic number 0xfeed on inode 1074266712 bad version number 0x0 on inode 1074266712 bad inode format in inode 1074266712 bad magic number 0x0 on inode 1074266713 bad version number 0x0 on inode 1074266713 bad (negative) size -7746721568139339722 on inode 1074266713 bad magic number 0xfeed on inode 1074266714 bad version number 0x0 on inode 1074266714 bad inode format in inode 1074266714 bad magic number 0x0 on inode 1074266715 bad version number 0x0 on inode 1074266715 bad (negative) size -7746721568139339722 on inode 1074266715 bad magic number 0xfeed on inode 1074266716 bad version number 0x0 on inode 1074266716 bad inode format in inode 1074266716 bad magic number 0x0 on inode 1074266717 bad version number 0x0 on inode 1074266717 bad (negative) size -7746721568139339722 on inode 1074266717 bad magic number 0xfeed on inode 1074266718 bad version number 0x0 on inode 1074266718 bad inode format in inode 1074266718 bad magic number 0x0 on inode 1074266719 bad version number 0x0 on inode 1074266719 bad (negative) size -7746721568139339722 on inode 1074266719 bad magic number 0xfeed on inode 1074266720 bad version number 0x0 on inode 1074266720 bad inode format in inode 1074266720 bad magic number 0x0 on inode 1074266721 bad version number 0x0 on inode 1074266721 bad (negative) size -7746721568139339722 on inode 1074266721 bad magic number 0xfeed on inode 1074266722 bad version number 0x0 on inode 1074266722 bad inode format in inode 1074266722 bad magic number 0x0 on inode 1074266723 bad version number 0x0 on inode 1074266723 bad (negative) size -7746721568139339722 on inode 1074266723 bad magic number 0xfeed on inode 1074266724 bad version number 0x0 on inode 1074266724 bad inode format in inode 1074266724 bad magic number 0x0 on inode 1074266725 bad version number 0x0 on inode 1074266725 bad (negative) size -7746721568139339722 on inode 1074266725 bad magic number 0xfeed on inode 1074266726 bad version number 0x0 on inode 1074266726 bad inode format in inode 1074266726 bad magic number 0x0 on inode 1074266727 bad version number 0x0 on inode 1074266727 bad (negative) size -7746721568139339722 on inode 1074266727 bad magic number 0xfeed on inode 1074266728 bad version number 0x0 on inode 1074266728 bad inode format in inode 1074266728 bad magic number 0x0 on inode 1074266729 bad version number 0x0 on inode 1074266729 bad (negative) size -7746721568139339722 on inode 1074266729 bad magic number 0xfeed on inode 1074266730 bad version number 0x0 on inode 1074266730 bad inode format in inode 1074266730 bad magic number 0x0 on inode 1074266731 bad version number 0x0 on inode 1074266731 bad (negative) size -7746721568139339722 on inode 1074266731 bad magic number 0xfeed on inode 1074266732 bad version number 0x0 on inode 1074266732 bad inode format in inode 1074266732 bad magic number 0x0 on inode 1074266733 bad version number 0x0 on inode 1074266733 bad (negative) size -7746721568139339722 on inode 1074266733 bad magic number 0xfeed on inode 1074266734 bad version number 0x0 on inode 1074266734 bad inode format in inode 1074266734 bad magic number 0x0 on inode 1074266735 bad version number 0x0 on inode 1074266735 bad (negative) size -7746721568139339722 on inode 1074266735 bad magic number 0xfeed on inode 1074266688, would reset magic number bad version number 0x0 on inode 1074266688, would reset version number bad inode format in inode 1074266688 would have cleared inode 1074266688 bad magic number 0x0 on inode 1074266689, would reset magic number bad version number 0x0 on inode 1074266689, would reset version number bad (negative) size -7746721568139339722 on inode 1074266689 would have cleared inode 1074266689 bad magic number 0xfeed on inode 1074266690, would reset magic number bad version number 0x0 on inode 1074266690, would reset version number bad inode format in inode 1074266690 would have cleared inode 1074266690 bad magic number 0x0 on inode 1074266691, would reset magic number bad version number 0x0 on inode 1074266691, would reset version number bad (negative) size -7746721568139339722 on inode 1074266691 would have cleared inode 1074266691 bad magic number 0xfeed on inode 1074266692, would reset magic number bad version number 0x0 on inode 1074266692, would reset version number bad inode format in inode 1074266692 would have cleared inode 1074266692 bad magic number 0x0 on inode 1074266693, would reset magic number bad version number 0x0 on inode 1074266693, would reset version number bad (negative) size -7746721568139339722 on inode 1074266693 would have cleared inode 1074266693 bad magic number 0xfeed on inode 1074266694, would reset magic number bad version number 0x0 on inode 1074266694, would reset version number bad inode format in inode 1074266694 would have cleared inode 1074266694 bad magic number 0x0 on inode 1074266695, would reset magic number bad version number 0x0 on inode 1074266695, would reset version number bad (negative) size -7746721568139339722 on inode 1074266695 would have cleared inode 1074266695 bad magic number 0xfeed on inode 1074266696, would reset magic number bad version number 0x0 on inode 1074266696, would reset version number bad inode format in inode 1074266696 would have cleared inode 1074266696 bad magic number 0x0 on inode 1074266697, would reset magic number bad version number 0x0 on inode 1074266697, would reset version number bad (negative) size -7746721568139339722 on inode 1074266697 would have cleared inode 1074266697 bad magic number 0xfeed on inode 1074266698, would reset magic number bad version number 0x0 on inode 1074266698, would reset version number bad inode format in inode 1074266698 would have cleared inode 1074266698 bad magic number 0x0 on inode 1074266699, would reset magic number bad version number 0x0 on inode 1074266699, would reset version number bad (negative) size -7746721568139339722 on inode 1074266699 would have cleared inode 1074266699 bad magic number 0xfeed on inode 1074266700, would reset magic number bad version number 0x0 on inode 1074266700, would reset version number bad inode format in inode 1074266700 would have cleared inode 1074266700 bad magic number 0x0 on inode 1074266701, would reset magic number bad version number 0x0 on inode 1074266701, would reset version number bad (negative) size -7746721568139339722 on inode 1074266701 would have cleared inode 1074266701 bad magic number 0xfeed on inode 1074266702, would reset magic number bad version number 0x0 on inode 1074266702, would reset version number bad inode format in inode 1074266702 would have cleared inode 1074266702 bad magic number 0x0 on inode 1074266703, would reset magic number bad version number 0x0 on inode 1074266703, would reset version number bad (negative) size -7746721568139339722 on inode 1074266703 would have cleared inode 1074266703 bad magic number 0xfeed on inode 1074266704, would reset magic number bad version number 0x0 on inode 1074266704, would reset version number bad inode format in inode 1074266704 would have cleared inode 1074266704 bad magic number 0x0 on inode 1074266705, would reset magic number bad version number 0x0 on inode 1074266705, would reset version number bad (negative) size -7746721568139339722 on inode 1074266705 would have cleared inode 1074266705 bad magic number 0xfeed on inode 1074266706, would reset magic number bad version number 0x0 on inode 1074266706, would reset version number bad inode format in inode 1074266706 would have cleared inode 1074266706 bad magic number 0x0 on inode 1074266707, would reset magic number bad version number 0x0 on inode 1074266707, would reset version number bad (negative) size -7746721568139339722 on inode 1074266707 would have cleared inode 1074266707 bad magic number 0xfeed on inode 1074266708, would reset magic number bad version number 0x0 on inode 1074266708, would reset version number bad inode format in inode 1074266708 would have cleared inode 1074266708 bad magic number 0x0 on inode 1074266709, would reset magic number bad version number 0x0 on inode 1074266709, would reset version number bad (negative) size -7746721568139339722 on inode 1074266709 would have cleared inode 1074266709 bad magic number 0xfeed on inode 1074266710, would reset magic number bad version number 0x0 on inode 1074266710, would reset version number bad inode format in inode 1074266710 would have cleared inode 1074266710 bad magic number 0x0 on inode 1074266711, would reset magic number bad version number 0x0 on inode 1074266711, would reset version number bad (negative) size -7746721568139339722 on inode 1074266711 would have cleared inode 1074266711 bad magic number 0xfeed on inode 1074266712, would reset magic number bad version number 0x0 on inode 1074266712, would reset version number bad inode format in inode 1074266712 would have cleared inode 1074266712 bad magic number 0x0 on inode 1074266713, would reset magic number bad version number 0x0 on inode 1074266713, would reset version number bad (negative) size -7746721568139339722 on inode 1074266713 would have cleared inode 1074266713 bad magic number 0xfeed on inode 1074266714, would reset magic number bad version number 0x0 on inode 1074266714, would reset version number bad inode format in inode 1074266714 would have cleared inode 1074266714 bad magic number 0x0 on inode 1074266715, would reset magic number bad version number 0x0 on inode 1074266715, would reset version number bad (negative) size -7746721568139339722 on inode 1074266715 would have cleared inode 1074266715 bad magic number 0xfeed on inode 1074266716, would reset magic number bad version number 0x0 on inode 1074266716, would reset version number bad inode format in inode 1074266716 would have cleared inode 1074266716 bad magic number 0x0 on inode 1074266717, would reset magic number bad version number 0x0 on inode 1074266717, would reset version number bad (negative) size -7746721568139339722 on inode 1074266717 would have cleared inode 1074266717 bad magic number 0xfeed on inode 1074266718, would reset magic number bad version number 0x0 on inode 1074266718, would reset version number bad inode format in inode 1074266718 would have cleared inode 1074266718 bad magic number 0x0 on inode 1074266719, would reset magic number bad version number 0x0 on inode 1074266719, would reset version number bad (negative) size -7746721568139339722 on inode 1074266719 would have cleared inode 1074266719 bad magic number 0xfeed on inode 1074266720, would reset magic number bad version number 0x0 on inode 1074266720, would reset version number bad inode format in inode 1074266720 would have cleared inode 1074266720 bad magic number 0x0 on inode 1074266721, would reset magic number bad version number 0x0 on inode 1074266721, would reset version number bad (negative) size -7746721568139339722 on inode 1074266721 would have cleared inode 1074266721 bad magic number 0xfeed on inode 1074266722, would reset magic number bad version number 0x0 on inode 1074266722, would reset version number bad inode format in inode 1074266722 would have cleared inode 1074266722 bad magic number 0x0 on inode 1074266723, would reset magic number bad version number 0x0 on inode 1074266723, would reset version number bad (negative) size -7746721568139339722 on inode 1074266723 would have cleared inode 1074266723 bad magic number 0xfeed on inode 1074266724, would reset magic number bad version number 0x0 on inode 1074266724, would reset version number bad inode format in inode 1074266724 would have cleared inode 1074266724 bad magic number 0x0 on inode 1074266725, would reset magic number bad version number 0x0 on inode 1074266725, would reset version number bad (negative) size -7746721568139339722 on inode 1074266725 would have cleared inode 1074266725 bad magic number 0xfeed on inode 1074266726, would reset magic number bad version number 0x0 on inode 1074266726, would reset version number bad inode format in inode 1074266726 would have cleared inode 1074266726 bad magic number 0x0 on inode 1074266727, would reset magic number bad version number 0x0 on inode 1074266727, would reset version number bad (negative) size -7746721568139339722 on inode 1074266727 would have cleared inode 1074266727 bad magic number 0xfeed on inode 1074266728, would reset magic number bad version number 0x0 on inode 1074266728, would reset version number bad inode format in inode 1074266728 would have cleared inode 1074266728 bad magic number 0x0 on inode 1074266729, would reset magic number bad version number 0x0 on inode 1074266729, would reset version number bad (negative) size -7746721568139339722 on inode 1074266729 would have cleared inode 1074266729 bad magic number 0xfeed on inode 1074266730, would reset magic number bad version number 0x0 on inode 1074266730, would reset version number bad inode format in inode 1074266730 would have cleared inode 1074266730 bad magic number 0x0 on inode 1074266731, would reset magic number bad version number 0x0 on inode 1074266731, would reset version number bad (negative) size -7746721568139339722 on inode 1074266731 would have cleared inode 1074266731 bad magic number 0xfeed on inode 1074266732, would reset magic number bad version number 0x0 on inode 1074266732, would reset version number bad inode format in inode 1074266732 would have cleared inode 1074266732 bad magic number 0x0 on inode 1074266733, would reset magic number bad version number 0x0 on inode 1074266733, would reset version number bad (negative) size -7746721568139339722 on inode 1074266733 would have cleared inode 1074266733 bad magic number 0xfeed on inode 1074266734, would reset magic number bad version number 0x0 on inode 1074266734, would reset version number bad inode format in inode 1074266734 would have cleared inode 1074266734 bad magic number 0x0 on inode 1074266735, would reset magic number bad version number 0x0 on inode 1074266735, would reset version number bad (negative) size -7746721568139339722 on inode 1074266735 would have cleared inode 1074266735 - agno = 9 - agno = 10 - agno = 11 - agno = 12 - agno = 13 - agno = 14 - agno = 15 - 16:12:07: process known inodes and inode discovery - 88832 of 88832 inodes done - process newly discovered inodes... - 16:12:07: process newly discovered inodes - 32 of 16 allocation groups done Phase 4 - check for duplicate blocks... - setting up duplicate extent list... - 16:12:07: setting up duplicate extent list - 16 of 16 allocation groups done - check for inodes claiming duplicate blocks... - agno = 0 - agno = 1 entry "sony_vndr" at block 0 offset 200 in directory inode 134218249 references non-existent inode 1074266626 would clear inode number in entry at offset 200... entry "nfs-premount" at block 0 offset 224 in directory inode 527 references non-existent inode 1074266640 would clear inode number in entry at offset 224... - agno = 2 entry "beagle" at block 0 offset 272 in directory inode 268435968 references non-existent inode 1074266634 would clear inode number in entry at offset 272... entry "freeradius" at block 0 offset 960 in directory inode 268435968 references non-existent inode 1074266637 would clear inode number in entry at offset 960... entry "libpaper.d" at block 0 offset 1440 in directory inode 268435968 references non-existent inode 1074266641 would clear inode number in entry at offset 1440... entry "readahead" at block 0 offset 2632 in directory inode 268435968 references non-existent inode 1074266645 would clear inode number in entry at offset 2632... entry "w3m" at block 1 offset 1864 in directory inode 268435968 references non-existent inode 1074266651 would clear inode number in entry at offset 1864... entry "keycodes" at block 0 offset 144 in directory inode 268435970 references non-existent inode 1074266625 would clear inode number in entry at offset 144... entry "bash_completion.d" at block 0 offset 344 in directory inode 268436146 references non-existent inode 1074266675 would clear inode number in entry at offset 344... entry "cron.hourly" at block 0 offset 696 in directory inode 268436146 references free inode 1074266706 would clear inode number in entry at offset 696... - agno = 3 - agno = 4 entry "cursors" at block 0 offset 176 in directory inode 536871424 references non-existent inode 1074266624 would clear inode number in entry at offset 176... - agno = 5 entry "mods-enabled" at block 0 offset 104 in directory inode 671089155 references non-existent inode 1074266627 would clear inode number in entry at offset 104... entry "ipv6-down.d" at block 0 offset 96 in directory inode 671089196 references non-existent inode 1074266644 would clear inode number in entry at offset 96... - agno = 6 entry "dhclient-exit-hooks.d" in shortform directory 805306886 references non-existent inode 1074266636 would have junked entry "dhclient-exit-hooks.d" in directory inode 805306886 entry "2.0" in shortform directory 805306892 references non-existent inode 1074266642 would have junked entry "2.0" in directory inode 805306892 entry "mods-available" at block 0 offset 72 in directory inode 805306942 references non-existent inode 1074266673 would clear inode number in entry at offset 72... entry "conf.d" in shortform directory 805306973 references free inode 1074266718 would have junked entry "conf.d" in directory inode 805306973 - agno = 7 entry "interfaces" at block 0 offset 48 in directory inode 939524614 references non-existent inode 1074266635 would clear inode number in entry at offset 48... entry "filter" in shortform directory 939524617 references non-existent inode 1074266638 would have junked entry "filter" in directory inode 939524617 entry "information" in shortform directory 939524618 references non-existent inode 1074266639 would have junked entry "information" in directory inode 939524618 entry "CPAN" in shortform directory 939524622 references non-existent inode 1074266643 would have junked entry "CPAN" in directory inode 939524622 entry "events" in shortform directory 939524694 references non-existent inode 1074266650 would have junked entry "events" in directory inode 939524694 entry "Xresources" at block 0 offset 104 in directory inode 939524700 references non-existent inode 1074266667 would clear inode number in entry at offset 104... entry "xinit" at block 0 offset 240 in directory inode 939524700 references non-existent inode 1074266668 would clear inode number in entry at offset 240... entry "config" at block 0 offset 48 in directory inode 939525159 references free inode 1074266709 would clear inode number in entry at offset 48... entry "site-start.d" in shortform directory 939525160 references free inode 1074266710 would have junked entry "site-start.d" in directory inode 939525160 - agno = 8 bad magic number 0xfeed on inode 1074266688, would reset magic number bad version number 0x0 on inode 1074266688, would reset version number bad inode format in inode 1074266688 would have cleared inode 1074266688 bad magic number 0x0 on inode 1074266689, would reset magic number bad version number 0x0 on inode 1074266689, would reset version number bad (negative) size -7746721568139339722 on inode 1074266689 would have cleared inode 1074266689 bad magic number 0xfeed on inode 1074266690, would reset magic number bad version number 0x0 on inode 1074266690, would reset version number bad inode format in inode 1074266690 would have cleared inode 1074266690 bad magic number 0x0 on inode 1074266691, would reset magic number bad version number 0x0 on inode 1074266691, would reset version number bad (negative) size -7746721568139339722 on inode 1074266691 would have cleared inode 1074266691 bad magic number 0xfeed on inode 1074266692, would reset magic number bad version number 0x0 on inode 1074266692, would reset version number bad inode format in inode 1074266692 would have cleared inode 1074266692 bad magic number 0x0 on inode 1074266693, would reset magic number bad version number 0x0 on inode 1074266693, would reset version number bad (negative) size -7746721568139339722 on inode 1074266693 would have cleared inode 1074266693 bad magic number 0xfeed on inode 1074266694, would reset magic number bad version number 0x0 on inode 1074266694, would reset version number bad inode format in inode 1074266694 would have cleared inode 1074266694 bad magic number 0x0 on inode 1074266695, would reset magic number bad version number 0x0 on inode 1074266695, would reset version number bad (negative) size -7746721568139339722 on inode 1074266695 would have cleared inode 1074266695 bad magic number 0xfeed on inode 1074266696, would reset magic number bad version number 0x0 on inode 1074266696, would reset version number bad inode format in inode 1074266696 would have cleared inode 1074266696 bad magic number 0x0 on inode 1074266697, would reset magic number bad version number 0x0 on inode 1074266697, would reset version number bad (negative) size -7746721568139339722 on inode 1074266697 would have cleared inode 1074266697 bad magic number 0xfeed on inode 1074266698, would reset magic number bad version number 0x0 on inode 1074266698, would reset version number bad inode format in inode 1074266698 would have cleared inode 1074266698 bad magic number 0x0 on inode 1074266699, would reset magic number bad version number 0x0 on inode 1074266699, would reset version number bad (negative) size -7746721568139339722 on inode 1074266699 would have cleared inode 1074266699 bad magic number 0xfeed on inode 1074266700, would reset magic number bad version number 0x0 on inode 1074266700, would reset version number bad inode format in inode 1074266700 would have cleared inode 1074266700 bad magic number 0x0 on inode 1074266701, would reset magic number bad version number 0x0 on inode 1074266701, would reset version number bad (negative) size -7746721568139339722 on inode 1074266701 would have cleared inode 1074266701 bad magic number 0xfeed on inode 1074266702, would reset magic number bad version number 0x0 on inode 1074266702, would reset version number bad inode format in inode 1074266702 would have cleared inode 1074266702 bad magic number 0x0 on inode 1074266703, would reset magic number bad version number 0x0 on inode 1074266703, would reset version number bad (negative) size -7746721568139339722 on inode 1074266703 would have cleared inode 1074266703 bad magic number 0xfeed on inode 1074266704, would reset magic number bad version number 0x0 on inode 1074266704, would reset version number bad inode format in inode 1074266704 would have cleared inode 1074266704 bad magic number 0x0 on inode 1074266705, would reset magic number bad version number 0x0 on inode 1074266705, would reset version number bad (negative) size -7746721568139339722 on inode 1074266705 would have cleared inode 1074266705 bad magic number 0xfeed on inode 1074266706, would reset magic number bad version number 0x0 on inode 1074266706, would reset version number bad inode format in inode 1074266706 would have cleared inode 1074266706 bad magic number 0x0 on inode 1074266707, would reset magic number bad version number 0x0 on inode 1074266707, would reset version number bad (negative) size -7746721568139339722 on inode 1074266707 would have cleared inode 1074266707 bad magic number 0xfeed on inode 1074266708, would reset magic number bad version number 0x0 on inode 1074266708, would reset version number bad inode format in inode 1074266708 would have cleared inode 1074266708 bad magic number 0x0 on inode 1074266709, would reset magic number bad version number 0x0 on inode 1074266709, would reset version number bad (negative) size -7746721568139339722 on inode 1074266709 would have cleared inode 1074266709 bad magic number 0xfeed on inode 1074266710, would reset magic number bad version number 0x0 on inode 1074266710, would reset version number bad inode format in inode 1074266710 would have cleared inode 1074266710 bad magic number 0x0 on inode 1074266711, would reset magic number bad version number 0x0 on inode 1074266711, would reset version number bad (negative) size -7746721568139339722 on inode 1074266711 would have cleared inode 1074266711 bad magic number 0xfeed on inode 1074266712, would reset magic number bad version number 0x0 on inode 1074266712, would reset version number bad inode format in inode 1074266712 would have cleared inode 1074266712 bad magic number 0x0 on inode 1074266713, would reset magic number bad version number 0x0 on inode 1074266713, would reset version number bad (negative) size -7746721568139339722 on inode 1074266713 would have cleared inode 1074266713 bad magic number 0xfeed on inode 1074266714, would reset magic number bad version number 0x0 on inode 1074266714, would reset version number bad inode format in inode 1074266714 would have cleared inode 1074266714 bad magic number 0x0 on inode 1074266715, would reset magic number bad version number 0x0 on inode 1074266715, would reset version number bad (negative) size -7746721568139339722 on inode 1074266715 would have cleared inode 1074266715 bad magic number 0xfeed on inode 1074266716, would reset magic number bad version number 0x0 on inode 1074266716, would reset version number bad inode format in inode 1074266716 would have cleared inode 1074266716 bad magic number 0x0 on inode 1074266717, would reset magic number bad version number 0x0 on inode 1074266717, would reset version number bad (negative) size -7746721568139339722 on inode 1074266717 would have cleared inode 1074266717 bad magic number 0xfeed on inode 1074266718, would reset magic number bad version number 0x0 on inode 1074266718, would reset version number bad inode format in inode 1074266718 would have cleared inode 1074266718 bad magic number 0x0 on inode 1074266719, would reset magic number bad version number 0x0 on inode 1074266719, would reset version number bad (negative) size -7746721568139339722 on inode 1074266719 would have cleared inode 1074266719 bad magic number 0xfeed on inode 1074266720, would reset magic number bad version number 0x0 on inode 1074266720, would reset version number bad inode format in inode 1074266720 would have cleared inode 1074266720 bad magic number 0x0 on inode 1074266721, would reset magic number bad version number 0x0 on inode 1074266721, would reset version number bad (negative) size -7746721568139339722 on inode 1074266721 would have cleared inode 1074266721 bad magic number 0xfeed on inode 1074266722, would reset magic number bad version number 0x0 on inode 1074266722, would reset version number bad inode format in inode 1074266722 would have cleared inode 1074266722 bad magic number 0x0 on inode 1074266723, would reset magic number bad version number 0x0 on inode 1074266723, would reset version number bad (negative) size -7746721568139339722 on inode 1074266723 would have cleared inode 1074266723 bad magic number 0xfeed on inode 1074266724, would reset magic number bad version number 0x0 on inode 1074266724, would reset version number bad inode format in inode 1074266724 would have cleared inode 1074266724 bad magic number 0x0 on inode 1074266725, would reset magic number bad version number 0x0 on inode 1074266725, would reset version number bad (negative) size -7746721568139339722 on inode 1074266725 would have cleared inode 1074266725 bad magic number 0xfeed on inode 1074266726, would reset magic number bad version number 0x0 on inode 1074266726, would reset version number bad inode format in inode 1074266726 would have cleared inode 1074266726 bad magic number 0x0 on inode 1074266727, would reset magic number bad version number 0x0 on inode 1074266727, would reset version number bad (negative) size -7746721568139339722 on inode 1074266727 would have cleared inode 1074266727 bad magic number 0xfeed on inode 1074266728, would reset magic number bad version number 0x0 on inode 1074266728, would reset version number bad inode format in inode 1074266728 would have cleared inode 1074266728 bad magic number 0x0 on inode 1074266729, would reset magic number bad version number 0x0 on inode 1074266729, would reset version number bad (negative) size -7746721568139339722 on inode 1074266729 would have cleared inode 1074266729 bad magic number 0xfeed on inode 1074266730, would reset magic number bad version number 0x0 on inode 1074266730, would reset version number bad inode format in inode 1074266730 would have cleared inode 1074266730 bad magic number 0x0 on inode 1074266731, would reset magic number bad version number 0x0 on inode 1074266731, would reset version number bad (negative) size -7746721568139339722 on inode 1074266731 would have cleared inode 1074266731 bad magic number 0xfeed on inode 1074266732, would reset magic number bad version number 0x0 on inode 1074266732, would reset version number bad inode format in inode 1074266732 would have cleared inode 1074266732 bad magic number 0x0 on inode 1074266733, would reset magic number bad version number 0x0 on inode 1074266733, would reset version number bad (negative) size -7746721568139339722 on inode 1074266733 would have cleared inode 1074266733 bad magic number 0xfeed on inode 1074266734, would reset magic number bad version number 0x0 on inode 1074266734, would reset version number bad inode format in inode 1074266734 would have cleared inode 1074266734 bad magic number 0x0 on inode 1074266735, would reset magic number bad version number 0x0 on inode 1074266735, would reset version number bad (negative) size -7746721568139339722 on inode 1074266735 would have cleared inode 1074266735 - agno = 9 entry ".." at block 0 offset 32 in directory inode 1207960072 references non-existent inode 1074266637 would clear inode number in entry at offset 32... entry ".." at block 0 offset 32 in directory inode 1207960114 references non-existent inode 1074266668 would clear inode number in entry at offset 32... - agno = 10 - agno = 11 - agno = 12 - agno = 13 - agno = 14 - agno = 15 - 16:12:07: check for inodes claiming duplicate blocks - 88768 of 88832 inodes done Phase 6 - check inode connectivity... - traversing filesystem starting at / ... entry "nfs-premount" in directory inode 527 points to non-existent inode, would junk entry entry "sony_vndr" in directory inode 134218249 points to non-existent inode, would junk entry entry "beagle" in directory inode 268435968 points to non-existent inode, would junk entry entry "freeradius" in directory inode 268435968 points to non-existent inode, would junk entry entry "libpaper.d" in directory inode 268435968 points to non-existent inode, would junk entry entry "readahead" in directory inode 268435968 points to non-existent inode, would junk entry entry "w3m" in directory inode 268435968 points to non-existent inode, would junk entry entry "keycodes" in directory inode 268435970 points to non-existent inode, would junk entry entry "bash_completion.d" in directory inode 268436146 points to non-existent inode, would junk entry entry "cron.hourly" in directory inode 268436146 points to free inode 1074266706, would junk entry entry "cursors" in directory inode 536871424 points to non-existent inode, would junk entry entry "mods-enabled" in directory inode 671089155 points to non-existent inode, would junk entry entry "ipv6-down.d" in directory inode 671089196 points to non-existent inode, would junk entry entry "dhclient-exit-hooks.d" in shortform directory 805306886 references non-existent inode 1074266636 would junk entry entry "dhclient-exit-hooks.d" in shortform directory 805306886 references non-existent inode 1074266636 would junk entry entry "2.0" in shortform directory 805306892 references non-existent inode 1074266642 would junk entry entry "2.0" in shortform directory 805306892 references non-existent inode 1074266642 would junk entry entry "2.0" in shortform directory 805306892 references non-existent inode 1074266642 would junk entry entry "mods-available" in directory inode 805306942 points to non-existent inode, would junk entry entry "conf.d" in shortform directory inode 805306973 points to free inode 1074266718 would junk entry "conf.d" entry "interfaces" in directory inode 939524614 points to non-existent inode, would junk entry entry "filter" in shortform directory 939524617 references non-existent inode 1074266638 would junk entry entry "filter" in shortform directory 939524617 references non-existent inode 1074266638 would junk entry entry "filter" in shortform directory 939524617 references non-existent inode 1074266638 would junk entry entry "information" in shortform directory 939524618 references non-existent inode 1074266639 would junk entry entry "information" in shortform directory 939524618 references non-existent inode 1074266639 would junk entry entry "information" in shortform directory 939524618 references non-existent inode 1074266639 would junk entry entry "CPAN" in shortform directory 939524622 references non-existent inode 1074266643 would junk entry entry "CPAN" in shortform directory 939524622 references non-existent inode 1074266643 would junk entry entry "CPAN" in shortform directory 939524622 references non-existent inode 1074266643 would junk entry entry "events" in shortform directory 939524694 references non-existent inode 1074266650 would junk entry entry "Xresources" in directory inode 939524700 points to non-existent inode, would junk entry entry "xinit" in directory inode 939524700 points to non-existent inode, would junk entry entry "config" in directory inode 939525159 points to free inode 1074266709, would junk entry entry "site-start.d" in shortform directory inode 939525160 points to free inode 1074266710 would junk entry "site-start.d" - 16:12:19: traversing filesystem - 16 of 16 allocation groups done - traversal finished ... - traversing all unattached subtrees ... - traversals finished ... - moving disconnected inodes to lost+found ... disconnected inode 805306949, would move to lost+found disconnected inode 805306958, would move to lost+found disconnected inode 805306959, would move to lost+found disconnected inode 939525150, would move to lost+found disconnected inode 939525151, would move to lost+found disconnected inode 1074266736, would move to lost+found disconnected inode 1074266737, would move to lost+found disconnected inode 1074266738, would move to lost+found disconnected inode 1074266740, would move to lost+found disconnected inode 1074266742, would move to lost+found disconnected inode 1074266743, would move to lost+found disconnected inode 1074266744, would move to lost+found disconnected inode 1074266747, would move to lost+found disconnected inode 1074266748, would move to lost+found disconnected inode 1074266749, would move to lost+found disconnected inode 1074266750, would move to lost+found disconnected inode 1074266751, would move to lost+found disconnected inode 1074267136, would move to lost+found disconnected inode 1074267137, would move to lost+found disconnected inode 1074267138, would move to lost+found disconnected inode 1074267139, would move to lost+found disconnected inode 1074267140, would move to lost+found disconnected inode 1074267141, would move to lost+found disconnected inode 1074267142, would move to lost+found disconnected inode 1074267143, would move to lost+found disconnected inode 1074267144, would move to lost+found disconnected inode 1074267145, would move to lost+found disconnected inode 1074267146, would move to lost+found disconnected inode 1074267147, would move to lost+found disconnected inode 1074267148, would move to lost+found disconnected inode 1074267149, would move to lost+found disconnected inode 1074267150, would move to lost+found disconnected inode 1074267151, would move to lost+found disconnected inode 1074267152, would move to lost+found disconnected inode 1074267153, would move to lost+found disconnected inode 1074267154, would move to lost+found disconnected inode 1074267155, would move to lost+found disconnected inode 1074267156, would move to lost+found disconnected inode 1074267157, would move to lost+found disconnected inode 1074267158, would move to lost+found disconnected inode 1074267159, would move to lost+found disconnected inode 1074267160, would move to lost+found disconnected inode 1074267161, would move to lost+found disconnected inode 1074267162, would move to lost+found disconnected inode 1074267163, would move to lost+found disconnected inode 1074267164, would move to lost+found disconnected inode 1074267165, would move to lost+found disconnected inode 1074267166, would move to lost+found disconnected inode 1074267167, would move to lost+found disconnected inode 1074267168, would move to lost+found disconnected inode 1074267169, would move to lost+found disconnected inode 1074267171, would move to lost+found disconnected inode 1074267172, would move to lost+found disconnected inode 1074267173, would move to lost+found disconnected inode 1074267174, would move to lost+found disconnected inode 1074267176, would move to lost+found disconnected inode 1074267177, would move to lost+found disconnected inode 1074267178, would move to lost+found disconnected inode 1074267179, would move to lost+found disconnected inode 1074267180, would move to lost+found disconnected inode 1074267181, would move to lost+found disconnected inode 1074267182, would move to lost+found disconnected inode 1074267183, would move to lost+found disconnected inode 1074267184, would move to lost+found disconnected inode 1074267185, would move to lost+found disconnected inode 1074267186, would move to lost+found disconnected inode 1074267187, would move to lost+found disconnected inode 1074267188, would move to lost+found disconnected inode 1074267189, would move to lost+found disconnected inode 1074267190, would move to lost+found disconnected inode 1074267191, would move to lost+found disconnected inode 1074267192, would move to lost+found disconnected inode 1074267193, would move to lost+found disconnected inode 1074267194, would move to lost+found disconnected inode 1074267195, would move to lost+found disconnected inode 1074267196, would move to lost+found disconnected inode 1074267197, would move to lost+found disconnected inode 1074267198, would move to lost+found disconnected inode 1074267199, would move to lost+found disconnected inode 1074267200, would move to lost+found disconnected inode 1074267201, would move to lost+found disconnected inode 1074267202, would move to lost+found disconnected inode 1074267203, would move to lost+found disconnected inode 1074267204, would move to lost+found disconnected inode 1074267205, would move to lost+found disconnected inode 1074267206, would move to lost+found disconnected inode 1074267207, would move to lost+found disconnected inode 1074267208, would move to lost+found disconnected inode 1074267209, would move to lost+found disconnected inode 1074267210, would move to lost+found disconnected inode 1074267211, would move to lost+found disconnected inode 1074267212, would move to lost+found disconnected inode 1074267213, would move to lost+found disconnected inode 1074267214, would move to lost+found disconnected inode 1074267215, would move to lost+found disconnected inode 1074267216, would move to lost+found disconnected inode 1074267217, would move to lost+found disconnected inode 1074267218, would move to lost+found disconnected inode 1074267219, would move to lost+found disconnected inode 1074267220, would move to lost+found disconnected inode 1074267221, would move to lost+found disconnected inode 1074267222, would move to lost+found disconnected inode 1074267223, would move to lost+found disconnected inode 1074267224, would move to lost+found disconnected inode 1074267225, would move to lost+found disconnected inode 1074267226, would move to lost+found disconnected inode 1074267227, would move to lost+found disconnected inode 1074267228, would move to lost+found disconnected inode 1074267229, would move to lost+found disconnected inode 1074267230, would move to lost+found disconnected inode 1074267231, would move to lost+found disconnected inode 1074267232, would move to lost+found disconnected inode 1074267233, would move to lost+found disconnected inode 1074267234, would move to lost+found disconnected inode 1074267235, would move to lost+found disconnected inode 1074267236, would move to lost+found disconnected inode 1074267237, would move to lost+found disconnected inode 1074267238, would move to lost+found disconnected inode 1074267239, would move to lost+found disconnected inode 1074267240, would move to lost+found disconnected inode 1074267241, would move to lost+found disconnected inode 1074267242, would move to lost+found disconnected inode 1074267243, would move to lost+found disconnected inode 1074267244, would move to lost+found disconnected inode 1074267245, would move to lost+found disconnected inode 1074267246, would move to lost+found disconnected inode 1074267247, would move to lost+found disconnected inode 1074267248, would move to lost+found disconnected inode 1074267249, would move to lost+found disconnected inode 1074267250, would move to lost+found disconnected inode 1074267251, would move to lost+found disconnected inode 1074267252, would move to lost+found disconnected inode 1074267253, would move to lost+found disconnected inode 1074267254, would move to lost+found disconnected inode 1074267255, would move to lost+found disconnected inode 1074267256, would move to lost+found disconnected inode 1074267257, would move to lost+found disconnected inode 1074267258, would move to lost+found disconnected inode 1074267259, would move to lost+found disconnected inode 1074267260, would move to lost+found disconnected inode 1074267261, would move to lost+found disconnected inode 1074267262, would move to lost+found disconnected inode 1074267263, would move to lost+found disconnected inode 1074267264, would move to lost+found disconnected inode 1074267265, would move to lost+found disconnected inode 1074267266, would move to lost+found disconnected inode 1074267267, would move to lost+found disconnected inode 1074267268, would move to lost+found disconnected inode 1074267269, would move to lost+found disconnected inode 1074267270, would move to lost+found disconnected inode 1074267271, would move to lost+found disconnected inode 1074267272, would move to lost+found disconnected inode 1074267277, would move to lost+found disconnected inode 1074267278, would move to lost+found disconnected inode 1074267801, would move to lost+found disconnected inode 1074267802, would move to lost+found disconnected inode 1074267803, would move to lost+found disconnected inode 1074267804, would move to lost+found disconnected inode 1074267806, would move to lost+found disconnected inode 1074267807, would move to lost+found disconnected inode 1074267808, would move to lost+found disconnected inode 1074267809, would move to lost+found disconnected inode 1074267810, would move to lost+found disconnected inode 1074267811, would move to lost+found disconnected inode 1074267812, would move to lost+found disconnected dir inode 1207960065, would move to lost+found disconnected dir inode 1207960072, would move to lost+found disconnected dir inode 1207960074, would move to lost+found disconnected dir inode 1207960078, would move to lost+found disconnected dir inode 1207960114, would move to lost+found disconnected dir inode 1342177793, would move to lost+found disconnected dir inode 1342177805, would move to lost+found disconnected dir inode 1342177809, would move to lost+found Phase 7 - verify link counts... would have reset inode 527 nlinks from 11 to 10 would have reset inode 134218249 nlinks from 11 to 10 would have reset inode 268435968 nlinks from 125 to 120 would have reset inode 268435970 nlinks from 10 to 9 would have reset inode 268436146 nlinks from 151 to 149 would have reset inode 536871424 nlinks from 9 to 8 would have reset inode 671089155 nlinks from 8 to 7 would have reset inode 671089196 nlinks from 8 to 7 would have reset inode 805306886 nlinks from 4 to 3 would have reset inode 805306892 nlinks from 4 to 3 would have reset inode 805306942 nlinks from 7 to 6 would have reset inode 805306973 nlinks from 4 to 3 would have reset inode 939524614 nlinks from 5 to 4 would have reset inode 939524617 nlinks from 3 to 2 would have reset inode 939524618 nlinks from 5 to 2 would have reset inode 939524622 nlinks from 5 to 2 would have reset inode 939524694 nlinks from 3 to 2 would have reset inode 939524700 nlinks from 11 to 9 would have reset inode 939525159 nlinks from 4 to 3 would have reset inode 939525160 nlinks from 3 to 2 - 16:12:25: verify link counts - 88768 of 88832 inodes done No modify flag set, skipping filesystem flush and exiting. --------------050705000404000303010802-- From owner-xfs@oss.sgi.com Mon Jan 28 02:38:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jan 2008 02:38:10 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0SAc1ae000642 for ; Mon, 28 Jan 2008 02:38:04 -0800 X-ASG-Debug-ID: 1201516700-1f0e01520000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ninsei.hu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6A97456B588 for ; Mon, 28 Jan 2008 02:38:21 -0800 (PST) Received: from ninsei.hu (ninsei.hu [212.92.23.158]) by cuda.sgi.com with ESMTP id ke4gGBe8w0QtS1eK for ; Mon, 28 Jan 2008 02:38:21 -0800 (PST) Received: from luba (pb-d-128-141-48-100.cern.ch [128.141.48.100]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by chatsubo.ninsei.hu (Postfix) with ESMTP id 8AD6C7A79 for ; Mon, 28 Jan 2008 11:38:17 +0100 (CET) Received: by luba (Postfix, from userid 32266) id C45D010A97F; Mon, 28 Jan 2008 11:38:15 +0100 (CET) Date: Mon, 28 Jan 2008 11:38:15 +0100 From: KELEMEN Peter To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH][DOC] xfs_stats.pl: xs_log_blocks counts in basic blocks Subject: [PATCH][DOC] xfs_stats.pl: xs_log_blocks counts in basic blocks Message-ID: <20080128103815.GA1777@luba> Mail-Followup-To: xfs@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Organization: CERN European Laboratory for Particle Physics, Switzerland X-GPG-KeyID: 1024D/9FF0CABE 2004-04-03 X-GPG-Fingerprint: 6C9E 5917 3B06 E4EE 6356 7BF0 8F3E CAB6 9FF0 CABE X-Comment: Personal opinion. Paragraphs might have been reformatted. X-Copyright: Forwarding or publishing without permission is prohibited. X-Accept-Language: hu,en User-Agent: Mutt/1.5.17 (2007-11-01) X-Barracuda-Connect: ninsei.hu[212.92.23.158] X-Barracuda-Start-Time: 1201516701 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40677 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5575/Mon Jan 28 00:58:23 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14290 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Peter.Kelemen@cern.ch Precedence: bulk X-list: xfs xs_log_blocks is counting in basic blocks, update documentation as discussed with Eric Sandeen on #xfs. Index: xfsmisc/xfs_stats.pl =================================================================== RCS file: /cvs/xfs-cmds/xfsmisc/xfs_stats.pl,v retrieving revision 1.5 diff -u -u -r1.5 xfs_stats.pl --- xfsmisc/xfs_stats.pl 10 Feb 2004 17:10:22 -0000 1.5 +++ xfsmisc/xfs_stats.pl 28 Jan 2008 10:34:05 -0000 @@ -337,7 +337,7 @@ =head2 B (I) -This variable counts the number of Kbytes of information being written +This variable counts (in 512-byte units) the information being written to the physical log partitions of all XFS filesystems. Log data traffic is proportional to the level of meta-data updating. The rate with which log data gets written depends on the size of internal log buffers and From owner-xfs@oss.sgi.com Mon Jan 28 18:08:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jan 2008 18:08:49 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0T28dKB007778 for ; Mon, 28 Jan 2008 18:08:41 -0800 X-ASG-Debug-ID: 1201572540-025700e20000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from fergie.hostexchange.net.au (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8A64A57119E for ; Mon, 28 Jan 2008 18:09:00 -0800 (PST) Received: from fergie.hostexchange.net.au (fergie.hostexchange.net.au [64.34.177.147]) by cuda.sgi.com with ESMTP id l36ktm4amhbyFurH for ; Mon, 28 Jan 2008 18:09:00 -0800 (PST) Received: from localhost (localhost) by fergie.hostexchange.net.au (8.13.4/8.13.4/Debian-3sarge3) id m0T28vv7012949; Tue, 29 Jan 2008 13:08:57 +1100 Date: Tue, 29 Jan 2008 13:08:57 +1100 From: Mail Delivery Subsystem Message-Id: <200801290208.m0T28vv7012949@fergie.hostexchange.net.au> To: postmaster@fergie.hostexchange.net.au To: MIME-Version: 1.0 Content-Type: multipart/report; report-type=delivery-status; boundary="m0T28vv7012949.1201572537/fergie.hostexchange.net.au" X-ASG-Orig-Subj: Returned mail: see transcript for details Subject: Returned mail: see transcript for details Auto-Submitted: auto-generated (failure) X-Barracuda-Connect: fergie.hostexchange.net.au[64.34.177.147] X-Barracuda-Start-Time: 1201572540 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0004 1.0000 -2.0184 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40739 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M BODY: Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/5590/Mon Jan 28 15:53:31 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14291 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: MAILER-DAEMON@fergie.hostexchange.net.au Precedence: bulk X-list: xfs This is a MIME-encapsulated message --m0T28vv7012949.1201572537/fergie.hostexchange.net.au The original message was received at Tue, 29 Jan 2008 13:08:56 +1100 from [222.106.183.12] ----- The following addresses had permanent fatal errors ----- ----- Transcript of session follows ----- 554 5.0.0 MX list for d9810.rotary.org.au. points back to fergie.hostexchange.net.au 554 5.3.5 Local configuration error --m0T28vv7012949.1201572537/fergie.hostexchange.net.au Content-Type: message/delivery-status Reporting-MTA: dns; fergie.hostexchange.net.au Received-From-MTA: DNS; [222.106.183.12] Arrival-Date: Tue, 29 Jan 2008 13:08:56 +1100 Final-Recipient: RFC822; club@d9810.rotary.org.au Action: failed Status: 5.5.0 Remote-MTA: DNS; d9810.rotary.org.au Last-Attempt-Date: Tue, 29 Jan 2008 13:08:57 +1100 --m0T28vv7012949.1201572537/fergie.hostexchange.net.au Content-Type: text/rfc822-headers Return-Path: Received: from d9810.rotary.org.au ([222.106.183.12]) by fergie.hostexchange.net.au (8.13.4/8.13.4/Debian-3sarge3) with ESMTP id m0T28sv7012947 for ; Tue, 29 Jan 2008 13:08:56 +1100 Message-Id: <200801290208.m0T28sv7012947@fergie.hostexchange.net.au> From: linux-xfs@oss.sgi.com To: club@d9810.rotary.org.au Subject: Re: Question Date: Tue, 29 Jan 2008 11:09:09 +0900 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0016----=_NextPart_000_0016" X-Priority: 3 X-MSMail-Priority: Normal --m0T28vv7012949.1201572537/fergie.hostexchange.net.au-- From owner-xfs@oss.sgi.com Mon Jan 28 19:22:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jan 2008 19:22:16 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0T3MADU011542 for ; Mon, 28 Jan 2008 19:22:13 -0800 X-ASG-Debug-ID: 1201576949-5541017e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ext.agami.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id ED4B5D222F7 for ; Mon, 28 Jan 2008 19:22:29 -0800 (PST) Received: from ext.agami.com (64.221.212.177.ptr.us.xo.net [64.221.212.177]) by cuda.sgi.com with ESMTP id uIQNOYRCCGlQVnu3 for ; Mon, 28 Jan 2008 19:22:29 -0800 (PST) Received: from agami.com (mail [192.168.168.5]) by ext.agami.com (8.12.5/8.12.5) with ESMTP id m0SLXrMM017416 for ; Mon, 28 Jan 2008 13:33:53 -0800 Received: from mx1.agami.com (mx1.agami.com [10.123.10.30]) by agami.com (8.12.11/8.12.11) with ESMTP id m0SLXlZh032537 for ; Mon, 28 Jan 2008 13:33:48 -0800 Received: from [10.123.4.142] ([10.123.4.142]) by mx1.agami.com with Microsoft SMTPSVC(6.0.3790.1830); Mon, 28 Jan 2008 13:34:10 -0800 Message-ID: <479E4A52.6000804@agami.com> Date: Mon, 28 Jan 2008 13:34:10 -0800 From: Michael Nishimoto User-Agent: Mail/News 1.5.0.4 (X11/20060629) MIME-Version: 1.0 To: XFS Mailing List X-ASG-Orig-Subj: Extent merging past MAXEXTLEN Subject: Extent merging past MAXEXTLEN Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 28 Jan 2008 21:34:10.0748 (UTC) FILETIME=[8511D7C0:01C861F5] X-Scanned-By: MIMEDefang 2.58 on 192.168.168.13 X-Barracuda-Connect: 64.221.212.177.ptr.us.xo.net[64.221.212.177] X-Barracuda-Start-Time: 1201576951 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0001 1.0000 -2.0202 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40744 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5590/Mon Jan 28 15:53:31 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14292 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: miken@agami.com Precedence: bulk X-list: xfs Hi everyone, Is there a reason to continue limiting extent merges past MAXEXTLEN on 64-bit systems? thanks, Mike From owner-xfs@oss.sgi.com Tue Jan 29 01:32:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jan 2008 01:32:28 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0T9WN8D008922 for ; Tue, 29 Jan 2008 01:32:25 -0800 X-ASG-Debug-ID: 1201599164-4c3e00f80000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from enyo.dsw2k3.info (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 50925572616 for ; Tue, 29 Jan 2008 01:32:44 -0800 (PST) Received: from enyo.dsw2k3.info (enyo.dsw2k3.info [195.71.86.239]) by cuda.sgi.com with ESMTP id 7WmCeKOuX0qEgfMS for ; Tue, 29 Jan 2008 01:32:44 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by enyo.dsw2k3.info (Postfix) with ESMTP id 918982BD61 for ; Tue, 29 Jan 2008 10:32:11 +0100 (CET) X-Virus-Scanned: ClamAV 0.91.2/5592/Tue Jan 29 00:38:24 2008 on oss.sgi.com X-Virus-Scanned: Debian amavisd-new at enyo.dsw2k3.info Received: from enyo.dsw2k3.info ([127.0.0.1]) by localhost (enyo.dsw2k3.info [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 9HPef71xli2Y for ; Tue, 29 Jan 2008 10:32:06 +0100 (CET) Received: from citd.de (p4FC4BD9B.dip.t-dialin.net [79.196.189.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by enyo.dsw2k3.info (Postfix) with ESMTP id 55CC22BD69 for ; Tue, 29 Jan 2008 10:32:05 +0100 (CET) Date: Tue, 29 Jan 2008 10:32:01 +0100 From: Matthias Schniedermeyer To: xfs@oss.sgi.com X-ASG-Orig-Subj: mkfs.xfs doesn't detect size of storage correctly Subject: mkfs.xfs doesn't detect size of storage correctly Message-ID: <20080129093201.GA16203@citd.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: enyo.dsw2k3.info[195.71.86.239] X-Barracuda-Start-Time: 1201599165 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-ASG-Whitelist: HEADER (^X-Barracuda-Connect: [^ ]+\.dsw2k3\.info\[) X-Virus-Status: Clean X-archive-position: 14293 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ms@citd.de Precedence: bulk X-list: xfs Hi Yesterday i bought a 750GB HDD. I encrypt nearly everything with loop-aes, so i also did it with this HDD. I create a "fake" partition table and: losetup -e aes256 -p 0 -o 4096 /dev/loop6 /dev/sdb < key This creates a loop with everything except the first 4KB, i.e. it leaves out the MBR and another 3,5KB. /proc/partions shows the correct(tm) size informations for the HDD and the loop: - snip - 7 6 732574580 loop6 8 16 732574584 sdb 8 17 732572001 sdb1 - snip - But when i mkfs.xfs the loop #> mkfs.xfs /dev/loop6 meta-data=/dev/loop6 isize=256 agcount=3, agsize=45785911 blks = sectsz=512 attr=2 data = bsize=4096 blocks=137357733, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 log =internal log bsize=4096 blocks=32768, version=2 = sectsz=512 sunit=0 blks, lazy-count=0 realtime =none extsz=4096 blocks=0, rtextents=0 And mount it: mount /dev/loop6 /mnt And least but not least df it: #> df -m /mnt Filesystem 1M-blocks Used Available Use% Mounted on /dev/loop6 536426 5 536422 1% /mnt There is roughly 1/3 missing. What can i do to fix this? #> mkfs.xfs -V mkfs.xfs version 2.9.5 (Package is from: Debian SID/unstable) Kernel is 2.6.24 (vanilla, plus of course the external module: loop-aes) Btw. I have 50 other HDDs in more or less exactly the same setup, (49 HDDs >= 200 GB and <= 500GB and one 1TB, of couse created with my system at an older stage from Feb 2007 onwoard, the 750GB is the first with kernel 2.6.24.) Up to now i can't remember ever "missing" space. Bis denn -- Real Programmers consider "what you see is what you get" to be just as bad a concept in Text Editors as it is in women. No, the Real Programmer wants a "you asked for it, you got it" text editor -- complicated, cryptic, powerful, unforgiving, dangerous. From owner-xfs@oss.sgi.com Tue Jan 29 02:15:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jan 2008 02:15:29 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0TAFKFL012925 for ; Tue, 29 Jan 2008 02:15:20 -0800 X-ASG-Debug-ID: 1201601736-0f7903240000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from postoffice.aconex.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 687F75729BB for ; Tue, 29 Jan 2008 02:15:36 -0800 (PST) Received: from postoffice.aconex.com (prod.aconex.com [203.89.192.138]) by cuda.sgi.com with ESMTP id RIdcHEa59ojgIjqs for ; Tue, 29 Jan 2008 02:15:36 -0800 (PST) Received: from mail.aconex.com (castle.yarra.acx [192.168.3.3]) by postoffice.aconex.com (Postfix) with ESMTP id B159192C804; Tue, 29 Jan 2008 21:15:02 +1100 (EST) Received: from 192.168.3.1 (proxying for 58.107.42.33) (SquirrelMail authenticated user nscott) by mail.aconex.com with HTTP; Tue, 29 Jan 2008 21:15:02 +1100 (EST) Message-ID: <43347.192.168.3.1.1201601702.squirrel@mail.aconex.com> In-Reply-To: <20080129093201.GA16203@citd.de> References: <20080129093201.GA16203@citd.de> Date: Tue, 29 Jan 2008 21:15:02 +1100 (EST) X-ASG-Orig-Subj: Re: mkfs.xfs doesn't detect size of storage correctly Subject: Re: mkfs.xfs doesn't detect size of storage correctly From: nscott@aconex.com To: "Matthias Schniedermeyer" Cc: xfs@oss.sgi.com User-Agent: SquirrelMail/1.4.8-4.el4.centos MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Barracuda-Connect: prod.aconex.com[203.89.192.138] X-Barracuda-Start-Time: 1201601741 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.47 X-Barracuda-Spam-Status: No, SCORE=-1.47 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=NO_REAL_NAME X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40769 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.55 NO_REAL_NAME From: does not include a real name X-Virus-Scanned: ClamAV 0.91.2/5592/Tue Jan 29 00:38:24 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14294 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 > Hi > > > Yesterday i bought a 750GB HDD. > I encrypt nearly everything with loop-aes, so i also did it with this > HDD. > > I create a "fake" partition table and: > losetup -e aes256 -p 0 -o 4096 /dev/loop6 /dev/sdb < key > > This creates a loop with everything except the first 4KB, i.e. it leaves > out the MBR and another 3,5KB. > > /proc/partions shows the correct(tm) size informations for the HDD and > the loop: > - snip - > 7 6 732574580 loop6 > 8 16 732574584 sdb > 8 17 732572001 sdb1 > - snip - > > But when i mkfs.xfs the loop > #> mkfs.xfs /dev/loop6 > meta-data=/dev/loop6 isize=256 agcount=3, agsize=45785911 > blks > = sectsz=512 attr=2 > data = bsize=4096 blocks=137357733, imaxpct=25 > = sunit=0 swidth=0 blks > naming =version 2 bsize=4096 > log =internal log bsize=4096 blocks=32768, version=2 > = sectsz=512 sunit=0 blks, lazy-count=0 > realtime =none extsz=4096 blocks=0, rtextents=0 > > And mount it: > mount /dev/loop6 /mnt > > And least but not least df it: > #> df -m /mnt > Filesystem 1M-blocks Used Available Use% Mounted on > /dev/loop6 536426 5 536422 1% /mnt > > There is roughly 1/3 missing. > > What can i do to fix this? mkfs.xfs uses the BLKGETSIZE64 ioctl to extract the device size, so the problem is likely in the loop device driver (just a guess). You can use the test program xfs-cmds/xfstests/src/getdevicesize.c to test what that device returns as its size (no XFS-specific code in the test program, so if it returns bad data we've narrowed down the root cause a whole lot). What does that program produce for your device? cheers. -- Nathan From owner-xfs@oss.sgi.com Tue Jan 29 04:21:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jan 2008 04:21:29 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0TCLMHh026392 for ; Tue, 29 Jan 2008 04:21:24 -0800 X-ASG-Debug-ID: 1201609297-2c9400570000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from enyo.dsw2k3.info (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CF42A568558 for ; Tue, 29 Jan 2008 04:21:37 -0800 (PST) Received: from enyo.dsw2k3.info (enyo.dsw2k3.info [195.71.86.239]) by cuda.sgi.com with ESMTP id 4G0XDM1jsBJBXD9z for ; Tue, 29 Jan 2008 04:21:37 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by enyo.dsw2k3.info (Postfix) with ESMTP id D996D2BC55; Tue, 29 Jan 2008 13:21:03 +0100 (CET) X-Virus-Scanned: ClamAV 0.91.2/5594/Tue Jan 29 02:06:32 2008 on oss.sgi.com X-Virus-Scanned: Debian amavisd-new at enyo.dsw2k3.info Received: from enyo.dsw2k3.info ([127.0.0.1]) by localhost (enyo.dsw2k3.info [127.0.0.1]) (amavisd-new, port 10024) with LMTP id S9ZizP-Z7UiW; Tue, 29 Jan 2008 13:20:56 +0100 (CET) Received: from citd.de (p4FC4BD9B.dip.t-dialin.net [79.196.189.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by enyo.dsw2k3.info (Postfix) with ESMTP id 761A52BC51; Tue, 29 Jan 2008 13:20:55 +0100 (CET) Date: Tue, 29 Jan 2008 13:20:51 +0100 From: Matthias Schniedermeyer To: nscott@aconex.com Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: mkfs.xfs doesn't detect size of storage correctly Subject: Re: mkfs.xfs doesn't detect size of storage correctly Message-ID: <20080129122051.GA18165@citd.de> References: <20080129093201.GA16203@citd.de> <43347.192.168.3.1.1201601702.squirrel@mail.aconex.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43347.192.168.3.1.1201601702.squirrel@mail.aconex.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: enyo.dsw2k3.info[195.71.86.239] X-Barracuda-Start-Time: 1201609303 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-ASG-Whitelist: HEADER (^X-Barracuda-Connect: [^ ]+\.dsw2k3\.info\[) X-Virus-Status: Clean X-archive-position: 14295 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ms@citd.de Precedence: bulk X-list: xfs On 29.01.2008 21:15, nscott@aconex.com wrote: > > Hi > > > > > > Yesterday i bought a 750GB HDD. > > I encrypt nearly everything with loop-aes, so i also did it with this > > HDD. > > > > I create a "fake" partition table and: > > losetup -e aes256 -p 0 -o 4096 /dev/loop6 /dev/sdb < key > > > > This creates a loop with everything except the first 4KB, i.e. it leaves > > out the MBR and another 3,5KB. > > > > /proc/partions shows the correct(tm) size informations for the HDD and > > the loop: > > - snip - > > 7 6 732574580 loop6 > > 8 16 732574584 sdb > > 8 17 732572001 sdb1 > > - snip - > > > > But when i mkfs.xfs the loop > > #> mkfs.xfs /dev/loop6 > > meta-data=/dev/loop6 isize=256 agcount=3, agsize=45785911 > > blks > > = sectsz=512 attr=2 > > data = bsize=4096 blocks=137357733, imaxpct=25 > > = sunit=0 swidth=0 blks > > naming =version 2 bsize=4096 > > log =internal log bsize=4096 blocks=32768, version=2 > > = sectsz=512 sunit=0 blks, lazy-count=0 > > realtime =none extsz=4096 blocks=0, rtextents=0 > > > > And mount it: > > mount /dev/loop6 /mnt > > > > And least but not least df it: > > #> df -m /mnt > > Filesystem 1M-blocks Used Available Use% Mounted on > > /dev/loop6 536426 5 536422 1% /mnt > > > > There is roughly 1/3 missing. > > > > What can i do to fix this? > > mkfs.xfs uses the BLKGETSIZE64 ioctl to extract the device size, so > the problem is likely in the loop device driver (just a guess). You > can use the test program xfs-cmds/xfstests/src/getdevicesize.c to > test what that device returns as its size (no XFS-specific code in the > test program, so if it returns bad data we've narrowed down the root > cause a whole lot). > > What does that program produce for your device? After a little odyssey to actually finding getdevicesize.c :-) #> wget 'http://oss.sgi.com/cgi-bin/cvsweb.cgi/~checkout~/xfs-cmds/xfstests/src/getdevicesize.c?rev=1.3;content-type=text%2Fplain' -O getdevicesize.c #> gcc -o getdevicesize getdevicesize.c #> ./getdevicesize /dev/loop6 1465149160 512 byte blocks (BLKGETSIZE64) Which is 750156369920 bytes or 732574580 KBytes, IOW EXACTLY the number reported in /proc/partions for the loop. A maybe important detail, i forgot to mention in the original mail is: The machine has 8GB of RAM, so i compiled the kernel with "64bit=yes" (formaly x86_64), BUT(!) the userspace is 32bit or plain old i386. I only need the RAM for a large tmpfs. So i didn't reinstall the machine with a 64bit userspace when i switched the hardware from a Dual P3 with 3GB to a Core2Duo with 8GB. Bis denn -- Real Programmers consider "what you see is what you get" to be just as bad a concept in Text Editors as it is in women. No, the Real Programmer wants a "you asked for it, you got it" text editor -- complicated, cryptic, powerful, unforgiving, dangerous. From owner-xfs@oss.sgi.com Tue Jan 29 07:19:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jan 2008 07:19:31 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0TFJPrd008541 for ; Tue, 29 Jan 2008 07:19:27 -0800 X-ASG-Debug-ID: 1201619986-079a01350000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2094F573F04 for ; Tue, 29 Jan 2008 07:19:46 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id 9QKpH282rch1iMqA for ; Tue, 29 Jan 2008 07:19:46 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 760D018DA1718; Tue, 29 Jan 2008 09:19:44 -0600 (CST) Message-ID: <479F440F.2060506@sandeen.net> Date: Tue, 29 Jan 2008 09:19:43 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Matthias Schniedermeyer CC: nscott@aconex.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: mkfs.xfs doesn't detect size of storage correctly Subject: Re: mkfs.xfs doesn't detect size of storage correctly References: <20080129093201.GA16203@citd.de> <43347.192.168.3.1.1201601702.squirrel@mail.aconex.com> <20080129122051.GA18165@citd.de> In-Reply-To: <20080129122051.GA18165@citd.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1201619987 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40791 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5598/Tue Jan 29 06:28:04 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14296 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 Matthias Schniedermeyer wrote: > A maybe important detail, i forgot to mention in the original mail is: > The machine has 8GB of RAM, so i compiled the kernel with "64bit=yes" > (formaly x86_64), BUT(!) the userspace is 32bit or plain old i386. If you think that's the issue, I'd try compiling the above as a 32-bit binary and re-run. Although, for a simple sparse-file-backed loopback device w/o loop-aes, that doesn't cause any problem for me: [root@inode tmp]# ls -l loopfile -rw-r--r-- 1 root root 750156369920 2008-01-29 08:53 loopfile [root@inode tmp]# losetup /dev/loop0 loopfile [root@inode tmp]# ./gds32 /dev/loop0 1465149160 512 byte blocks (BLKGETSIZE64) [root@inode tmp]# ./gds64 /dev/loop0 1465149160 512 byte blocks (BLKGETSIZE64) -Eric > Bis denn > From owner-xfs@oss.sgi.com Tue Jan 29 07:33:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jan 2008 07:33:35 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0TFXRgt011612 for ; Tue, 29 Jan 2008 07:33:28 -0800 X-ASG-Debug-ID: 1201620828-039403b60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from enyo.dsw2k3.info (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8EDA357443E for ; Tue, 29 Jan 2008 07:33:49 -0800 (PST) Received: from enyo.dsw2k3.info (enyo.dsw2k3.info [195.71.86.239]) by cuda.sgi.com with ESMTP id 1HBWGfGaMBXRbKWh for ; Tue, 29 Jan 2008 07:33:49 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by enyo.dsw2k3.info (Postfix) with ESMTP id 38F772BC51; Tue, 29 Jan 2008 16:33:47 +0100 (CET) X-Virus-Scanned: ClamAV 0.91.2/5598/Tue Jan 29 06:28:04 2008 on oss.sgi.com X-Virus-Scanned: Debian amavisd-new at enyo.dsw2k3.info Received: from enyo.dsw2k3.info ([127.0.0.1]) by localhost (enyo.dsw2k3.info [127.0.0.1]) (amavisd-new, port 10024) with LMTP id OG5Kfj9gTb4J; Tue, 29 Jan 2008 16:33:41 +0100 (CET) Received: from citd.de (p4FC4BD9B.dip.t-dialin.net [79.196.189.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by enyo.dsw2k3.info (Postfix) with ESMTP id 5FA762BC48; Tue, 29 Jan 2008 16:33:40 +0100 (CET) Date: Tue, 29 Jan 2008 16:33:37 +0100 From: Matthias Schniedermeyer To: Eric Sandeen Cc: nscott@aconex.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: mkfs.xfs doesn't detect size of storage correctly Subject: Re: mkfs.xfs doesn't detect size of storage correctly Message-ID: <20080129153337.GA20509@citd.de> References: <20080129093201.GA16203@citd.de> <43347.192.168.3.1.1201601702.squirrel@mail.aconex.com> <20080129122051.GA18165@citd.de> <479F440F.2060506@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <479F440F.2060506@sandeen.net> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: enyo.dsw2k3.info[195.71.86.239] X-Barracuda-Start-Time: 1201620829 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-ASG-Whitelist: HEADER (^X-Barracuda-Connect: [^ ]+\.dsw2k3\.info\[) X-Virus-Status: Clean X-archive-position: 14297 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ms@citd.de Precedence: bulk X-list: xfs On 29.01.2008 09:19, Eric Sandeen wrote: > Matthias Schniedermeyer wrote: > > > A maybe important detail, i forgot to mention in the original mail is: > > The machine has 8GB of RAM, so i compiled the kernel with "64bit=yes" > > (formaly x86_64), BUT(!) the userspace is 32bit or plain old i386. > > If you think that's the issue, I'd try compiling the above as a 32-bit > binary and re-run. I don't think it's an issue, i just wanted to mention it. But as soon as i get home i will connect the HDD to an all 32bit system and see if it makes a difference. (I'm still undecided if i should hope that it makes a difference. ;-) ) Bis denn -- Real Programmers consider "what you see is what you get" to be just as bad a concept in Text Editors as it is in women. No, the Real Programmer wants a "you asked for it, you got it" text editor -- complicated, cryptic, powerful, unforgiving, dangerous. From owner-xfs@oss.sgi.com Tue Jan 29 07:42:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jan 2008 07:42:46 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0TFgdJ3013900 for ; Tue, 29 Jan 2008 07:42:41 -0800 X-ASG-Debug-ID: 1201621376-376c00e80000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DCBFBD2B921 for ; Tue, 29 Jan 2008 07:42:56 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id uhWvE4ADc0Tj1jQV for ; Tue, 29 Jan 2008 07:42:56 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id B819918062C67; Tue, 29 Jan 2008 09:42:22 -0600 (CST) Message-ID: <479F495E.4070700@sandeen.net> Date: Tue, 29 Jan 2008 09:42:22 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Matthias Schniedermeyer CC: nscott@aconex.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: mkfs.xfs doesn't detect size of storage correctly Subject: Re: mkfs.xfs doesn't detect size of storage correctly References: <20080129093201.GA16203@citd.de> <43347.192.168.3.1.1201601702.squirrel@mail.aconex.com> <20080129122051.GA18165@citd.de> <479F440F.2060506@sandeen.net> <20080129153337.GA20509@citd.de> In-Reply-To: <20080129153337.GA20509@citd.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1201621380 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40792 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5598/Tue Jan 29 06:28:04 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14298 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 Matthias Schniedermeyer wrote: > On 29.01.2008 09:19, Eric Sandeen wrote: >> Matthias Schniedermeyer wrote: >> >>> A maybe important detail, i forgot to mention in the original mail is: >>> The machine has 8GB of RAM, so i compiled the kernel with "64bit=yes" >>> (formaly x86_64), BUT(!) the userspace is 32bit or plain old i386. >> If you think that's the issue, I'd try compiling the above as a 32-bit >> binary and re-run. > > I don't think it's an issue, i just wanted to mention it. > > But as soon as i get home i will connect the HDD to an all 32bit system > and see if it makes a difference. (I'm still undecided if i should hope > that it makes a difference. ;-) ) > well, this can't be hard to find, with a bit of investigation. :) As Nathan said, mkfs.xfs just uses standard ioctls to get device size, so something is odd... you could sprinkle some printfs into the mkfs code, too, to further debug. -Eric > > > Bis denn > From owner-xfs@oss.sgi.com Tue Jan 29 08:59:09 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jan 2008 08:59:14 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0TGx6K9031794 for ; Tue, 29 Jan 2008 08:59:09 -0800 X-ASG-Debug-ID: 1201625966-375901f40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from enyo.dsw2k3.info (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id ADAAD12335BD for ; Tue, 29 Jan 2008 08:59:27 -0800 (PST) Received: from enyo.dsw2k3.info (enyo.dsw2k3.info [195.71.86.239]) by cuda.sgi.com with ESMTP id j05qdMoRelOOJQiw for ; Tue, 29 Jan 2008 08:59:27 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by enyo.dsw2k3.info (Postfix) with ESMTP id 325F92BC55; Tue, 29 Jan 2008 17:58:53 +0100 (CET) X-Virus-Scanned: ClamAV 0.91.2/5598/Tue Jan 29 06:28:04 2008 on oss.sgi.com X-Virus-Scanned: Debian amavisd-new at enyo.dsw2k3.info Received: from enyo.dsw2k3.info ([127.0.0.1]) by localhost (enyo.dsw2k3.info [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 6diCvuAlDLqx; Tue, 29 Jan 2008 17:58:45 +0100 (CET) Received: from citd.de (p4FC4BD9B.dip.t-dialin.net [79.196.189.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by enyo.dsw2k3.info (Postfix) with ESMTP id F0EE02BC51; Tue, 29 Jan 2008 17:58:44 +0100 (CET) Date: Tue, 29 Jan 2008 17:58:42 +0100 From: Matthias Schniedermeyer To: Eric Sandeen Cc: nscott@aconex.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: mkfs.xfs doesn't detect size of storage correctly Subject: Re: mkfs.xfs doesn't detect size of storage correctly Message-ID: <20080129165842.GA21228@citd.de> References: <20080129093201.GA16203@citd.de> <43347.192.168.3.1.1201601702.squirrel@mail.aconex.com> <20080129122051.GA18165@citd.de> <479F440F.2060506@sandeen.net> <20080129153337.GA20509@citd.de> <479F495E.4070700@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <479F495E.4070700@sandeen.net> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: enyo.dsw2k3.info[195.71.86.239] X-Barracuda-Start-Time: 1201625967 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-ASG-Whitelist: HEADER (^X-Barracuda-Connect: [^ ]+\.dsw2k3\.info\[) X-Virus-Status: Clean X-archive-position: 14299 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ms@citd.de Precedence: bulk X-list: xfs On 29.01.2008 09:42, Eric Sandeen wrote: > Matthias Schniedermeyer wrote: > > On 29.01.2008 09:19, Eric Sandeen wrote: > >> Matthias Schniedermeyer wrote: > >> > >>> A maybe important detail, i forgot to mention in the original mail is: > >>> The machine has 8GB of RAM, so i compiled the kernel with "64bit=yes" > >>> (formaly x86_64), BUT(!) the userspace is 32bit or plain old i386. > >> If you think that's the issue, I'd try compiling the above as a 32-bit > >> binary and re-run. > > > > I don't think it's an issue, i just wanted to mention it. > > > > But as soon as i get home i will connect the HDD to an all 32bit system > > and see if it makes a difference. (I'm still undecided if i should hope > > that it makes a difference. ;-) ) I'm back home, and i just connected the HDD to my all 32bit system. No difference. Bis denn -- Real Programmers consider "what you see is what you get" to be just as bad a concept in Text Editors as it is in women. No, the Real Programmer wants a "you asked for it, you got it" text editor -- complicated, cryptic, powerful, unforgiving, dangerous. From owner-xfs@oss.sgi.com Tue Jan 29 09:16:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jan 2008 09:16:55 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0THGpdw000761 for ; Tue, 29 Jan 2008 09:16:53 -0800 X-ASG-Debug-ID: 1201627029-432402090000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from enyo.dsw2k3.info (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BFBC8574D67 for ; Tue, 29 Jan 2008 09:17:09 -0800 (PST) Received: from enyo.dsw2k3.info (enyo.dsw2k3.info [195.71.86.239]) by cuda.sgi.com with ESMTP id 7nRj8oDhlzQSwYx0 for ; Tue, 29 Jan 2008 09:17:09 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by enyo.dsw2k3.info (Postfix) with ESMTP id B00662BC53 for ; Tue, 29 Jan 2008 18:17:07 +0100 (CET) X-Virus-Scanned: ClamAV 0.91.2/5599/Tue Jan 29 08:27:10 2008 on oss.sgi.com X-Virus-Scanned: Debian amavisd-new at enyo.dsw2k3.info Received: from enyo.dsw2k3.info ([127.0.0.1]) by localhost (enyo.dsw2k3.info [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ICgYVF5UuXwX for ; Tue, 29 Jan 2008 18:17:01 +0100 (CET) Received: from citd.de (p4FC4BD9B.dip.t-dialin.net [79.196.189.155]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by enyo.dsw2k3.info (Postfix) with ESMTP id 24A192BC51 for ; Tue, 29 Jan 2008 18:17:01 +0100 (CET) Date: Tue, 29 Jan 2008 18:16:58 +0100 From: Matthias Schniedermeyer To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: mkfs.xfs doesn't detect size of storage correctly Subject: Re: mkfs.xfs doesn't detect size of storage correctly Message-ID: <20080129171658.GB21228@citd.de> References: <20080129093201.GA16203@citd.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080129093201.GA16203@citd.de> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: enyo.dsw2k3.info[195.71.86.239] X-Barracuda-Start-Time: 1201627032 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-ASG-Whitelist: HEADER (^X-Barracuda-Connect: [^ ]+\.dsw2k3\.info\[) X-Virus-Status: Clean X-archive-position: 14300 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ms@citd.de Precedence: bulk X-list: xfs On 29.01.2008 10:32, Matthias Schniedermeyer wrote: > Hi > > > Yesterday i bought a 750GB HDD. > I encrypt nearly everything with loop-aes, so i also did it with this > HDD. > > I create a "fake" partition table and: > losetup -e aes256 -p 0 -o 4096 /dev/loop6 /dev/sdb < key > > This creates a loop with everything except the first 4KB, i.e. it leaves > out the MBR and another 3,5KB. > > /proc/partions shows the correct(tm) size informations for the HDD and > the loop: > - snip - > 7 6 732574580 loop6 > 8 16 732574584 sdb > 8 17 732572001 sdb1 > - snip - > > But when i mkfs.xfs the loop > #> mkfs.xfs /dev/loop6 > meta-data=/dev/loop6 isize=256 agcount=3, agsize=45785911 blks > = sectsz=512 attr=2 > data = bsize=4096 blocks=137357733, imaxpct=25 > = sunit=0 swidth=0 blks > naming =version 2 bsize=4096 > log =internal log bsize=4096 blocks=32768, version=2 > = sectsz=512 sunit=0 blks, lazy-count=0 > realtime =none extsz=4096 blocks=0, rtextents=0 I just found a workaround. :-) As can be seen above the agcount is 3. For a reason that lays years in the past, when there were issues with the agcount (actually agsize), that to the best of my knowledge are fixed years ago (but still cause a weird feeling whenever i see that word) i just tried '-d agcount=4' #> mkfs.xfs -l size=1024b -d agcount=4 /dev/loop6 -f meta-data=/dev/loop6 isize=256 agcount=4, agsize=45785912 blks = sectsz=512 attr=2 data = bsize=4096 blocks=183143645, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 log =internal log bsize=4096 blocks=32768, version=2 = sectsz=512 sunit=0 blks, lazy-count=0 realtime =none extsz=4096 blocks=0, rtextents=0 As can be seen the "blocks"-number is much higher. #> df -k /mnt Filesystem 1K-blocks Used Available Use% Mounted on /dev/loop6 732570484 4256 732566228 1% /mnt matches(tm) with the loop-size. So i'm "burned" by agcount/agsize AGAIN, seems my weird feeling about those two words are still with reason. ;-) Bis denn -- Real Programmers consider "what you see is what you get" to be just as bad a concept in Text Editors as it is in women. No, the Real Programmer wants a "you asked for it, you got it" text editor -- complicated, cryptic, powerful, unforgiving, dangerous. From owner-xfs@oss.sgi.com Tue Jan 29 12:14:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jan 2008 12:14:38 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0TKEXv7012325 for ; Tue, 29 Jan 2008 12:14:35 -0800 X-ASG-Debug-ID: 1201637692-211f006c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F0546D3A2EA for ; Tue, 29 Jan 2008 12:14:52 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id ZuU2D4lRcabcQvmI for ; Tue, 29 Jan 2008 12:14:52 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id B6C0218DA0B20; Tue, 29 Jan 2008 14:14:50 -0600 (CST) Message-ID: <479F893A.1030402@sandeen.net> Date: Tue, 29 Jan 2008 14:14:50 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Matthias Schniedermeyer CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: mkfs.xfs doesn't detect size of storage correctly Subject: Re: mkfs.xfs doesn't detect size of storage correctly References: <20080129093201.GA16203@citd.de> <20080129171658.GB21228@citd.de> In-Reply-To: <20080129171658.GB21228@citd.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1201637694 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40810 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5599/Tue Jan 29 08:27:10 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14301 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 Matthias Schniedermeyer wrote: > I just found a workaround. :-) > As can be seen above the agcount is 3. > > For a reason that lays years in the past, when there were issues with > the agcount (actually agsize), that to the best of my knowledge are > fixed years ago (but still cause a weird feeling whenever i see that > word) i just tried '-d agcount=4' > > #> mkfs.xfs -l size=1024b -d agcount=4 /dev/loop6 -f > meta-data=/dev/loop6 isize=256 agcount=4, agsize=45785912 blks > = sectsz=512 attr=2 > data = bsize=4096 blocks=183143645, imaxpct=25 > = sunit=0 swidth=0 blks > naming =version 2 bsize=4096 > log =internal log bsize=4096 blocks=32768, version=2 > = sectsz=512 sunit=0 blks, lazy-count=0 > realtime =none extsz=4096 blocks=0, rtextents=0 > > As can be seen the "blocks"-number is much higher. > > #> df -k /mnt > Filesystem 1K-blocks Used Available Use% Mounted on > /dev/loop6 732570484 4256 732566228 1% /mnt > > matches(tm) with the loop-size. > Ohh.. um... Barry? problems :) [root@magnesium tmp]# mkfs.xfs -dfile,name=xfsfile,size=750156369920 meta-data=xfsfile isize=256 agcount=3, agsize=45785911 blks = sectsz=512 attr=2 data = bsize=4096 blocks=137357733, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 log =internal log bsize=4096 blocks=32768, version=2 = sectsz=512 sunit=0 blks, lazy-count=0 realtime =none extsz=4096 blocks=0, rtextents=0 [root@magnesium tmp]# bc bc 1.06 Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. 137357733*4096 562617274368 ouch... that's, um, not the right size :) -Eric From owner-xfs@oss.sgi.com Tue Jan 29 13:21:14 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jan 2008 13:21:17 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0TLLCJj021332 for ; Tue, 29 Jan 2008 13:21:14 -0800 X-ASG-Debug-ID: 1201641693-50f603530000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1109D5780EA for ; Tue, 29 Jan 2008 13:21:33 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id bGQUrQk6Ofx8g4kZ for ; Tue, 29 Jan 2008 13:21:33 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 1510E18DA1718; Tue, 29 Jan 2008 15:21:01 -0600 (CST) Message-ID: <479F98BC.6060507@sandeen.net> Date: Tue, 29 Jan 2008 15:21:00 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Chris Wedgwood CC: Matthias Schniedermeyer , xfs@oss.sgi.com, Barry Naujok X-ASG-Orig-Subj: Re: mkfs.xfs doesn't detect size of storage correctly Subject: Re: mkfs.xfs doesn't detect size of storage correctly References: <20080129093201.GA16203@citd.de> <20080129171658.GB21228@citd.de> <479F893A.1030402@sandeen.net> <20080129203731.GA29094@puku.stupidest.org> In-Reply-To: <20080129203731.GA29094@puku.stupidest.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1201641694 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40815 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5599/Tue Jan 29 08:27:10 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14302 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 Chris Wedgwood wrote: > On Tue, Jan 29, 2008 at 02:14:50PM -0600, Eric Sandeen wrote: > > >> [root@magnesium tmp]# mkfs.xfs -dfile,name=xfsfile,size=750156369920 >> > > I see this too except I'm pre-creating a file of the right length: > > -rw-r--r-- 1 root root 750156369920 Jan 29 12:35 xfsfile > > [...] > > /root/xfsfile xfs 524G 4.2M 524G 1% /mnt/tmp > > I think this fixes it, but it was just a quickie so pls double check :) if agcount * agsize <= dblocks, then the last ag shouldn't be "small" -Eric Index: xfsprogs-2.9.5/mkfs/xfs_mkfs.c =================================================================== --- xfsprogs-2.9.5.orig/mkfs/xfs_mkfs.c +++ xfsprogs-2.9.5/mkfs/xfs_mkfs.c @@ -523,7 +523,8 @@ validate_ag_geometry( * If the last AG is too small, reduce the filesystem size * and drop the blocks. */ - if ( dblocks % agsize != 0 && + if ( agcount * agsize > dblocks && + dblocks % agsize != 0 && (dblocks % agsize < XFS_AG_MIN_BLOCKS(blocklog))) { fprintf(stderr, _("last AG size %lld blocks too small, minimum size is %lld blocks\n"), @@ -1808,7 +1809,8 @@ _("size %s specified for log subvolume i * If the last AG is too small, reduce the filesystem size * and drop the blocks. */ - if ( dblocks % agsize != 0 && + if ( agcount * agsize > dblocks && + dblocks % agsize != 0 && (dblocks % agsize < XFS_AG_MIN_BLOCKS(blocklog))) { dblocks = (xfs_drfsbno_t)((agcount - 1) * agsize); agcount--; From owner-xfs@oss.sgi.com Tue Jan 29 17:16:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jan 2008 17:16:39 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: **** X-Spam-Status: No, score=4.2 required=5.0 tests=BAYES_99,URIBL_GREY autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0U1GUDO006234 for ; Tue, 29 Jan 2008 17:16:34 -0800 X-ASG-Debug-ID: 1201655809-67fd00e90000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp5.icpbounce.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 975455799C5 for ; Tue, 29 Jan 2008 17:16:49 -0800 (PST) Received: from smtp5.icpbounce.com (smtp5.icpbounce.com [216.27.93.121]) by cuda.sgi.com with ESMTP id 77E61FETuPFpR0SG for ; Tue, 29 Jan 2008 17:16:49 -0800 (PST) X-ASG-Whitelist: Sender Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp5.icpbounce.com (Postfix) with ESMTP id B2B6F16F298 for ; Tue, 29 Jan 2008 20:16:17 -0500 (EST) Date: Tue, 29 Jan 2008 20:16:17 -0500 To: linux-xfs@oss.sgi.com From: Fernando Rizzolo X-ASG-Orig-Subj: Blog do Rizzolo Newsletter Subject: Blog do Rizzolo Newsletter Message-ID: <5a0a765e90efebed0b2d535f98ea33e1@localhost.localdomain> X-Priority: 3 X-Mailer: PHPMailer [version 1.72] X-Unsubscribe-Web: X-ICPINFO: X-Return-Path-Hint: bounces+179028.7604696.42447@icpbounce.com MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="iso-8859-1" X-Barracuda-Connect: smtp5.icpbounce.com[216.27.93.121] X-Barracuda-Start-Time: 1201655812 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/5600/Tue Jan 29 13:52:23 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14303 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: blogdorizzolo@gmail.com Precedence: bulk X-list: xfs If you are having trouble viewing this message, please go to http://community.icontact.com/p/rizzolot/newsletters/blogdorizzolo. Prezado amigo(a) , Sou Advogado, escrevo na Agência Estado e em vários portais, tenho um Blog sobre política e economia. Gostaria de convida-lo(a) a conhecer e participar. Blog do Rizzolo http://rizzolot.wordpress.com Grande abraço! Fernando Rizzolo CASO NÃO QUEIRA MAIS RECEBER ESSA NEWSLETTER, FAVOR CLICAR ABAIXO EM " REMOVE" Muito obrigado ! This message was sent by: Fernando Rizzolo, Rua Escuilo, 66, São Paulo, no , Brazil Powered by iContact: http://freetrial.icontact.com Remita a un amigo: http://app.icontact.com/icp/sub/forward?m=42447&s=7604696&c=JRCB&cid=179028 Comment on this message http://community.icontact.com/p/rizzolot/newsletters/blogdorizzolo/posts/blog-do-rizzolo-newsletter5#commentform To be removed click here: http://app.icontact.com/icp/mmail-mprofile.pl?r=7604696&l=4148&s=JRCB&m=42447&c=179028 Receive our messages as an RSS feed: http://rizzolot.icontact.com/newsletters/rss.xml?r=7604696&l=4148&s=JRCB&m=42447&c=179028 From owner-xfs@oss.sgi.com Wed Jan 30 15:26:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 30 Jan 2008 15:26:27 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0UNQIXi008275 for ; Wed, 30 Jan 2008 15:26:24 -0800 X-ASG-Debug-ID: 1201735599-5dcb03300000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from enyo.dsw2k3.info (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B09785821A0 for ; Wed, 30 Jan 2008 15:26:40 -0800 (PST) Received: from enyo.dsw2k3.info (enyo.dsw2k3.info [195.71.86.239]) by cuda.sgi.com with ESMTP id G3CrFWqrudazO5Iq for ; Wed, 30 Jan 2008 15:26:40 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by enyo.dsw2k3.info (Postfix) with ESMTP id 5869D2BC53 for ; Thu, 31 Jan 2008 00:26:38 +0100 (CET) X-Virus-Scanned: ClamAV 0.91.2/5619/Wed Jan 30 13:55:02 2008 on oss.sgi.com X-Virus-Scanned: Debian amavisd-new at enyo.dsw2k3.info Received: from enyo.dsw2k3.info ([127.0.0.1]) by localhost (enyo.dsw2k3.info [127.0.0.1]) (amavisd-new, port 10024) with LMTP id X2ddSYNM4wgy for ; Thu, 31 Jan 2008 00:26:33 +0100 (CET) Received: from citd.de (p4FC4ED8B.dip.t-dialin.net [79.196.237.139]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by enyo.dsw2k3.info (Postfix) with ESMTP id 8C35B2BC47 for ; Thu, 31 Jan 2008 00:26:32 +0100 (CET) Date: Thu, 31 Jan 2008 00:26:28 +0100 From: Matthias Schniedermeyer To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: mkfs.xfs doesn't detect size of storage correctly Subject: Re: mkfs.xfs doesn't detect size of storage correctly Message-ID: <20080130232628.GA9671@citd.de> References: <20080129093201.GA16203@citd.de> <20080129171658.GB21228@citd.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080129171658.GB21228@citd.de> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: enyo.dsw2k3.info[195.71.86.239] X-Barracuda-Start-Time: 1201735600 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-ASG-Whitelist: HEADER (^X-Barracuda-Connect: [^ ]+\.dsw2k3\.info\[) X-Virus-Status: Clean X-archive-position: 14304 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ms@citd.de Precedence: bulk X-list: xfs A little followup. Today i bought another 750GB HDD, and a 500GB. Initializing the encryption of the 500GB finished a minute ago and the same bug, of course with a different size (357702MB), was observable. Workaround also worked in this case (Now its 476937MB). This also proves that the bug is of recent nature, the last 500GB HDD i bought was just over a month ago and this bug didn't show up then. Bis denn -- Real Programmers consider "what you see is what you get" to be just as bad a concept in Text Editors as it is in women. No, the Real Programmer wants a "you asked for it, you got it" text editor -- complicated, cryptic, powerful, unforgiving, dangerous. From owner-xfs@oss.sgi.com Wed Jan 30 19:23:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 30 Jan 2008 19:23:06 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-3.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0V3Mwuv027504 for ; Wed, 30 Jan 2008 19:23:02 -0800 X-ASG-Debug-ID: 1201749799-1af400c90000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 25DA9D5631D; Wed, 30 Jan 2008 19:23:19 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by cuda.sgi.com with ESMTP id BjramapMkR2HCGUJ; Wed, 30 Jan 2008 19:23:19 -0800 (PST) Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m0V3NIFQ016988; Wed, 30 Jan 2008 22:23:18 -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 m0V3NHAI025880; Wed, 30 Jan 2008 22:23:17 -0500 Received: from liberator.sandeen.net (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox-2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m0V3NGN3015263; Wed, 30 Jan 2008 22:23:17 -0500 Message-ID: <47A13F24.4090408@redhat.com> Date: Wed, 30 Jan 2008 21:23:16 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Barry Naujok , Niv Sardi , xfs-oss X-ASG-Orig-Subj: xfsprogs patch for calc_default_ag_geometry Subject: xfsprogs patch for calc_default_ag_geometry Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Barracuda-Connect: mx1.redhat.com[66.187.233.31] X-Barracuda-Start-Time: 1201749800 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40931 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5619/Wed Jan 30 13:55:02 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14306 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@redhat.com Precedence: bulk X-list: xfs was just looking at this a little tonight. I wonder if something like this makes things any more correct and/or readable. The patch looks a little ugly but once applied I think the code makes more sense, it more closely follows the original spirit of the function, while still implementing the goal of different geometries for single disks. Most importantly it doesn't skip the tricky: count = dblocks / blocks + (dblocks % blocks != 0); which is probably what caused the regression. Or maybe you guys already have your own fix :) Index: xfsprogs-2.9.5/mkfs/xfs_mkfs.c =================================================================== --- xfsprogs-2.9.5.orig/mkfs/xfs_mkfs.c +++ xfsprogs-2.9.5/mkfs/xfs_mkfs.c @@ -413,6 +413,8 @@ calc_default_ag_geometry( * First handle the extremes - the points at which we will * always use the maximum AG size, the points at which we * always use the minimum, and a "small-step" for 16-128Mb. + * + * These are chosen regardless of single- or multi-disk. */ if (dblocks >= TERABYTES(32, blocklog)) { blocks = XFS_AG_MAX_BLOCKS(blocklog); @@ -427,6 +429,9 @@ calc_default_ag_geometry( } /* + * Sizes in the middle. + * + * For multidisk: * For the remainder we choose an AG size based on the * number of data blocks available, trying to keep the * number of AGs relatively small (especially compared @@ -436,34 +441,34 @@ calc_default_ag_geometry( * smaller counts at mkfs time. * * This scales us up smoothly between min/max AG sizes. + * + * For a single disk: + * Limit to 4 ags, unless quite large, then + * max out the AG size. */ - if (!multidisk) { - if (dblocks >= TERABYTES(4, blocklog)) { + if (multidisk) { + if (dblocks > GIGABYTES(512, blocklog)) + shift = 5; + else if (dblocks > GIGABYTES(8, blocklog)) + shift = 4; + else if (dblocks >= MEGABYTES(128, blocklog)) + shift = 3; + else + ASSERT(0); + } else { + if (dblocks < TERABYTES(4, blocklog)) + shift = 2; + else { blocks = XFS_AG_MAX_BLOCKS(blocklog); - goto done; - } - count = 4; - - goto done; - } - - if (dblocks > GIGABYTES(512, blocklog)) - shift = 5; - else if (dblocks > GIGABYTES(8, blocklog)) - shift = 4; - else if (dblocks >= MEGABYTES(128, blocklog)) - shift = 3; - else - ASSERT(0); - blocks = dblocks >> shift; + goto done; + } + } + blocks = dblocks >> shift; done: - ASSERT (count || blocks); if (!count) count = dblocks / blocks + (dblocks % blocks != 0); - if (!blocks) - blocks = dblocks / count; *agsize = blocks; *agcount = count; From owner-xfs@oss.sgi.com Wed Jan 30 19:22:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 30 Jan 2008 19:22:19 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0V3MBWW027409 for ; Wed, 30 Jan 2008 19:22:15 -0800 X-ASG-Debug-ID: 1201749461-340001b80000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 22420D56FCA for ; Wed, 30 Jan 2008 19:17:41 -0800 (PST) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id HkkAJyDlwGg9FRmo for ; Wed, 30 Jan 2008 19:17:41 -0800 (PST) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 5254918DAF2D1; Wed, 30 Jan 2008 21:17:38 -0600 (CST) Message-ID: <47A13DD1.1010908@sandeen.net> Date: Wed, 30 Jan 2008 21:17:37 -0600 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Matthias Schniedermeyer CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: mkfs.xfs doesn't detect size of storage correctly Subject: Re: mkfs.xfs doesn't detect size of storage correctly References: <20080129093201.GA16203@citd.de> <20080129171658.GB21228@citd.de> <20080130232628.GA9671@citd.de> In-Reply-To: <20080130232628.GA9671@citd.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1201749462 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.40931 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5619/Wed Jan 30 13:55:02 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14305 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 Matthias Schniedermeyer wrote: > A little followup. > > Today i bought another 750GB HDD, and a 500GB. > > Initializing the encryption of the 500GB finished a minute ago and the > same bug, of course with a different size (357702MB), was observable. > > Workaround also worked in this case (Now its 476937MB). This also proves > that the bug is of recent nature, the last 500GB HDD i bought was just > over a month ago and this bug didn't show up then. Yes, it's a regression in 2.9.5. http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfsprogs/mkfs/xfs_mkfs.c.diff?r1=1.82;r2=1.83 -Eric From owner-xfs@oss.sgi.com Thu Jan 31 14:25:09 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 31 Jan 2008 14:25:15 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: **** X-Spam-Status: No, score=4.0 required=5.0 tests=BAYES_99 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0VMP6Ef002548 for ; Thu, 31 Jan 2008 14:25:09 -0800 X-ASG-Debug-ID: 1201818327-02e802c40000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wizard.svr18-speedyservers.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9522FD662D6 for ; Thu, 31 Jan 2008 14:25:28 -0800 (PST) Received: from wizard.svr18-speedyservers.com (wizard.svr18-speedyservers.com [195.8.196.23]) by cuda.sgi.com with ESMTP id kzOixRO0AfOoLZlU for ; Thu, 31 Jan 2008 14:25:28 -0800 (PST) Received: from nobody by wizard.svr18-speedyservers.com with local (Exim 4.68) (envelope-from ) id 1JKhq2-0005uM-Ci for linux-xfs@oss.sgi.com; Thu, 31 Jan 2008 22:24:54 +0000 To: linux-xfs@oss.sgi.com X-ASG-Orig-Subj: SGT. Sumpta Writes From Iraq Subject: SGT. Sumpta Writes From Iraq From: "robert.sumpta T SSG MIL USA USARPAC" Reply-To: sgt.robert@Army.com MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit Message-Id: Date: Thu, 31 Jan 2008 22:24:54 +0000 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - wizard.svr18-speedyservers.com X-AntiAbuse: Original Domain - oss.sgi.com X-AntiAbuse: Originator/Caller UID/GID - [99 32002] / [47 12] X-AntiAbuse: Sender Address Domain - wizard.svr18-speedyservers.com X-Source: X-Source-Args: /usr/local/apache/bin/httpd -DSSL X-Source-Dir: nextlevelpost.com:/public_html X-Barracuda-Connect: wizard.svr18-speedyservers.com[195.8.196.23] X-Barracuda-Start-Time: 1201818328 X-Barracuda-Bayes: INNOCENT GLOBAL 0.5000 1.0000 0.7500 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.75 X-Barracuda-Spam-Status: No, SCORE=0.75 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.41007 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5628/Thu Jan 31 08:48:19 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14307 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: robert.sumpta@us.army.mil Precedence: bulk X-list: xfs This is my Life In Your Hands, I know you would be surprised to read from someone relatively unknown to you before. My name is SGT. Robert Sumpta, a member of the U.S. ARMY USARPAC Medical Team , which was deployed to Iraq in the beginning of the war in Iraq. I would like to share some highly personal classified information about my personal experience and role which I played in the pursuit of my career serving under the U.S 1st Armored which was at the fore-front of the war in Iraq. Though, I would like to hold back certain information for security reasons for now until you have find the time to visit the BBC website stated below to enable you have insight as to what I'm intending to share with you, believing that it would be of your desired interest oneway or the other. http://news.bbc.co.uk/2/hi/middle_east/2988455.stm Also, could you get back to me having visiting the above website to enable us discuss in a more clarifying manner to the best of your understanding. I must say that I'm very uncomfortable sending this message to you without knowing truly if you would misconstrue the importance and decides to go public. In this regards, I will not hold back to say that the essence of this message is strictly for mutual benefit of you and I and nothing more. I will be vivid and coherent in my next message in this regards, meanwhile, could you send me a mail confirming you have visited the site and that you have understood my intentions? I will await your thoughts. Thanks, Best Regards SGT. Robert Sumpta Private Email:(sgt.robert@Army.com) From owner-xfs@oss.sgi.com Thu Jan 31 14:39:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 31 Jan 2008 14:39:49 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,J_CHICKENPOX_43, J_CHICKENPOX_66 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m0VMdbVN004150 for ; Thu, 31 Jan 2008 14:39:41 -0800 X-ASG-Debug-ID: 1201819197-4c1301a50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from py-out-1112.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9E7DFD65E40 for ; Thu, 31 Jan 2008 14:39:57 -0800 (PST) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.183]) by cuda.sgi.com with ESMTP id wf2CsbNESFwD3ulZ for ; Thu, 31 Jan 2008 14:39:57 -0800 (PST) Received: by py-out-1112.google.com with SMTP id j37so943365pyc.4 for ; Thu, 31 Jan 2008 14:39:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=Rcdr3TmaM3Gwb368yY2sSHC4flzNj1gQf/Mb0ySoY+w=; b=rrSvF4EQ/jAmNVPDKboSeMSqn1kddoKttrM8A2c5awhx75CJCtvSGcUXesRAuAFupCtveuAZHDS7JJ6RxTrrhdcAn5FekrRQj26Qz6bq+w8eCFhkZ1n69vCX/zaBCVPpSoNtbVGfEnbpSQKlyOd8a11urAabWPYHE6Zd+HiRzwo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=unlOcCrFf2pIQ297+XrdekcIwSCuR+e/B+j+HfErmHJ7eodUoErgdaxPx61f7hQjNY8P8JKsnPWA7sI2ufPdCOfFEayBx+J0gQkNZ1sfeJY6akZD1hyGSgrnx0JQgJI0QXnyulef7mC/BBXPcA3Pg6f902SoFGC9ixbL5X7+5Rs= Received: by 10.140.134.15 with SMTP id h15mr1951209rvd.51.1201819195679; Thu, 31 Jan 2008 14:39:55 -0800 (PST) Received: by 10.141.74.13 with HTTP; Thu, 31 Jan 2008 14:39:55 -0800 (PST) Message-ID: <61a567a60801311439n668ed585t7c03a803da57244f@mail.gmail.com> Date: Thu, 31 Jan 2008 17:39:55 -0500 From: VR To: xfs@oss.sgi.com X-ASG-Orig-Subj: how to use attr_multi() properly ? Subject: how to use attr_multi() properly ? MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Barracuda-Connect: py-out-1112.google.com[64.233.166.183] X-Barracuda-Start-Time: 1201819199 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.41009 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/5628/Thu Jan 31 08:48:19 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14308 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: vreikine@gmail.com Precedence: bulk X-list: xfs Hi, I am trying to use attr_multi() in my small application on Linux. It's ArchLinux on Intel laptop Kernel is 2.6.23 filesystem is XFS getfattr --version returns 2.4.39 Basically, I want to use EA to store environment variables for an application - e.g. 'ant' needs ANT_HOME and ANT_LIB , 'jetty' needs JETTY_HOME etc. For any given file I want to get EA of "user.env.n" where n is 0...8 , so I allocated memory, created attr_multi_op_t array, filled it up with proper values etc. Then I make a call to attr_multi() and check the return code. I am getting the EA values ok, but my question is about return code, errno and am_error in attr_multiop_t . Here is the snippets of my code - it's rather long so I cut some pieces out. const char *ea_env = "env"; int main(int argc, char **argv) { int rc; int i,j,k,l,m,n; attr_multiop_t ea[EA_SIZE]; char *ea_buf[EA_SIZE]; char *ea_argname[EA_MAX_ARG]; char *ea_envname[EA_MAX_ENV]; char *ea_name, *ea_path, *ea_ext, *ea_self, *ea_selfs; char *tmpval, *tmpvall , *tmpvalll; /* initialization */ rc = 0; /* return code */ /* common params for all EA */ for ( i = 0; i < EA_SIZE; i++) { ea[i].am_opcode = ATTR_OP_GET ; ea[i].am_error = 0; ea[i].am_flags = 0; } /* . skipped not important stuff - */ /* names are in form "env.#" */ n = strlen(ea_env) + 2 + 1 ; /* limit number of args to 16 - 1 hex digit */ if ((tmpval = malloc( n * (EA_MAX_ENV & 0xF))) == NULL ) { perror("malloc: failed to allocate memory for ea_envname") ; _exit(errno); } memset(tmpval, 0, (n * EA_MAX_ARG & 0xF)) ; for ( i = 0; i < EA_MAX_ENV & 0xF ; i++) { ea_envname[i] = tmpval; snprintf(ea_envname[i], n, "%s.%x", ea_env, i) ; tmpval +=n ; ea_buf[EA_ENV+i] = malloc(EA_MAX_ARGLEN) ; if (ea_buf[EA_ENV+i] == NULL) { perror("malloc: failed to allocate memory for ea_env" ); _exit(errno); } ea[EA_ENV+i].am_attrname = ea_envname[i]; ea[EA_ENV+i].am_attrvalue = ea_buf[EA_ENV+i]; ea[EA_ENV+i].am_length = EA_MAX_ARGLEN ; } if (argc > 1) { printf("filename %s:\n",argv[1]); rc = attr_multi( argv[1], ea , EA_SIZE, 0); if ( rc != 0) { printf("rc= %d, errno = %d\n", rc, errno); } for ( i=0 ; i < EA_SIZE ; i++) { if (ea[i].am_error == 0 && (k = strlen(ea[i].am_attrvalue)) == ea[i].am_length) { printf(" %d:\t%s\t%s\t%d\t%d\n", i, ea[i].am_attrname, ea[i].am_attrvalue, ea[i].am_length, ea[i].am_error) ; /* skip not important stuff */ } } } /* skip not important stuff */ return rc; } I use gcc 4.2.2 and compile it with "-lattr" I use "setfattr" to set EA on a test file and let's say I set user.env.0 and user.env.1 to some values. I can see those values with "getfattr -d" and I can see them with my small command but am_error is always 0 - for all " env.#" no matter if they set or not. I have to use 'strlen()' and compare it to am_length to check if there is value of EA. and I am getting "rc = -1" and "errno = -22" (negative 22?), or "rc = -1" and "errno = 61" depending on EA I set or not set on a test file. I'd rather have am_error set to proper value if there is no data and check. Could you please advise on how to call attr_multi() to get a bunch of attributes at once properly, or is it better just do attr_get() in a loop ? Sincerely, Vladimir From owner-xfs@oss.sgi.com Thu Jan 31 20:10:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 31 Jan 2008 20:10:28 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m114ANrE001294 for ; Thu, 31 Jan 2008 20:10:24 -0800 X-ASG-Debug-ID: 1201839042-166c00420000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from postoffice.aconex.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0276358ADC1 for ; Thu, 31 Jan 2008 20:10:42 -0800 (PST) Received: from postoffice.aconex.com (prod.aconex.com [203.89.192.138]) by cuda.sgi.com with ESMTP id AD0bEK9QIEFtj2uU for ; Thu, 31 Jan 2008 20:10:42 -0800 (PST) Received: from mail.aconex.com (castle.yarra.acx [192.168.3.3]) by postoffice.aconex.com (Postfix) with ESMTP id E77AF92C3A9; Fri, 1 Feb 2008 15:10:07 +1100 (EST) Received: from 192.168.3.1 (proxying for 169.222.9.178) (SquirrelMail authenticated user nscott) by mail.aconex.com with HTTP; Fri, 1 Feb 2008 15:10:07 +1100 (EST) Message-ID: <35274.192.168.3.1.1201839007.squirrel@mail.aconex.com> In-Reply-To: <61a567a60801311439n668ed585t7c03a803da57244f@mail.gmail.com> References: <61a567a60801311439n668ed585t7c03a803da57244f@mail.gmail.com> Date: Fri, 1 Feb 2008 15:10:07 +1100 (EST) X-ASG-Orig-Subj: Re: how to use attr_multi() properly ? Subject: Re: how to use attr_multi() properly ? From: nscott@aconex.com To: "VR" Cc: xfs@oss.sgi.com User-Agent: SquirrelMail/1.4.8-4.el4.centos MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Barracuda-Connect: prod.aconex.com[203.89.192.138] X-Barracuda-Start-Time: 1201839045 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0003 1.0000 -2.0189 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.47 X-Barracuda-Spam-Status: No, SCORE=-1.47 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=3.0 tests=NO_REAL_NAME X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.41030 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.55 NO_REAL_NAME From: does not include a real name X-Virus-Scanned: ClamAV 0.91.2/5629/Thu Jan 31 14:21:01 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 14309 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 > Hi, > ... > Could you please advise on how to call attr_multi() to get a bunch of > attributes at once properly, or is it better just do attr_get() in a > loop ? Its better to just use attr_get in a loop (attr_multi on Linux is just a userspace wrapper around the xattr syscalls, and is provided for IRIX compatibility only). cheers. -- Nathan