Received: with ECARTIS (v1.0.0; list linux-xfs); Sun, 27 Oct 2002 18:56:03 -0800 (PST) Received: from ns.ad-hoc.org (IDENT:postfix@n226.brail.gakushuin.ac.jp [150.90.47.226]) by oss.sgi.com (8.12.5/8.12.5) with SMTP id g9S2txuR002487 for ; Sun, 27 Oct 2002 18:56:00 -0800 Received: from localhost.localdomain.ad-hoc.org (ns.ad-hoc.org [150.90.47.226]) by ns.ad-hoc.org (Postfix) with ESMTP id 8298C204062 for ; Mon, 28 Oct 2002 11:59:02 +0900 (JST) Date: Mon, 28 Oct 2002 11:51:50 +0900 Message-ID: From: Kazuhisa TAKEI To: linux-xfs@oss.sgi.com Subject: linvfs_get_dentry patch for 2.5.44 User-Agent: Wanderlust/2.8.1 (Something) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (=?ISO-8859-4?Q?Unebigory=F2mae?=) APEL/10.3 Emacs/21.2 (i386-vine-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: multipart/mixed; boundary="Multipart_Mon_Oct_28_11:51:50_2002-1" X-archive-position: 1323 X-ecartis-version: Ecartis v1.0.0 Sender: linux-xfs-bounce@oss.sgi.com Errors-to: linux-xfs-bounce@oss.sgi.com X-original-sender: takei@linux.or.jp Precedence: bulk X-list: linux-xfs --Multipart_Mon_Oct_28_11:51:50_2002-1 Content-Type: text/plain; charset=US-ASCII Hi this patch add linvfs_get_dentry to linvfs_set_inode_ops. in 2.5.44 XFS's kernel when dentry is not cached , if detnry is searched using find_export_dentry knfsd will do Oops. this probrem's is the only using NFS. This patch define linvfs_get_dentry and it avoid to perform read_inode. Probrem don't occur if read_inode was defined. Are There reason of removing linvfs_read_inode ? following is Oops case. Test Case: 1. server export server side: # mount -o xfs /dev/sdb1 /testexport # mkdir -k /testexport/a/b/c # exportfs nfsserver:/test 2. mounting in mounting client side: # mount nfsserver:/testexport /mounttest # cd /mounttest/a/b/c 3. reboot server and restart knfsd. ( dont umound in client side) 4. perform 'ls' cmd in client side # ls 5. print Oops in Serverside. Regards. --- Kazuhisa TAKEI --Multipart_Mon_Oct_28_11:51:50_2002-1 Content-Type: application/octet-stream; type=patch Content-Disposition: attachment; filename="xfs-linux25-export.diff" Content-Transfer-Encoding: 7bit ===== xfs_super.c 1.8 vs ? (writable without lock!) ===== --- /tmp/xfs_super.c-1.8-10037 Tue Oct 15 06:10:03 2002 +++ xfs_super.c Thu Oct 24 19:24:50 2002 @@ -531,6 +531,55 @@ linvfs_set_inode_ops( } } +struct dentry * +linvfs_get_dentry(struct super_block *sb, void *vp) +{ + __u32 *data = vp; + vfs_t *vfsp = LINVFS_GET_VFS(sb); + xfs_mount_t *mp = XFS_BHVTOM(vfsp->vfs_fbhv); + ino_t ino = (ino_t)data[0]; /*XXX*/ + __u32 generation = data[1]; /*XXX*/ + struct dentry *result; + struct inode *inode; + xfs_inode_t *ip; + int error; + + error = xfs_iget(mp, NULL, ino, XFS_ILOCK_SHARED, &ip, 0); + if (error) + return ERR_PTR(-error); + if (ip == NULL) + return ERR_PTR(-EIO); + + if (ip->i_d.di_mode == 0) { + result = ERR_PTR(-ENOENT); + goto error_iput; + } + + if (ip->i_d.di_gen != generation) { + result = ERR_PTR(-ENOENT); + goto error_iput; + } + + inode = LINVFS_GET_IP(XFS_ITOV(ip)); + if (inode->i_generation != generation) { + result = ERR_PTR(-ENOENT); + goto error_iput; + } + xfs_iunlock(ip, XFS_ILOCK_SHARED); + + result = d_alloc_anon(inode); + if (!result) { + iput(inode); + return ERR_PTR(-ENOMEM); + } + result->d_vfs_flags |= DCACHE_REFERENCED; + return result; + +error_iput: + xfs_iput_new(ip, XFS_ILOCK_SHARED); + return result; +} + /* * We do not actually write the inode here, just mark the * super block dirty so that sync_supers calls us and @@ -756,6 +805,7 @@ linvfs_get_sb( STATIC struct export_operations linvfs_export_ops = { .get_parent = linvfs_get_parent, + .get_dentry = linvfs_get_dentry, }; STATIC int --Multipart_Mon_Oct_28_11:51:50_2002-1--