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 insensi