Re: XFS: inode with st_mode == 0

From: David Greaves
Date: Fri Jan 14 2005 - 13:18:56 EST



Christoph Hellwig wrote:

We have applied these two patches to 2.6.10-rc2, but this
does not help. A few minutes ago I've got the "?----------" file
again from my test script. This time it took >4 hours (it was
about an hour or so without this patch).


I'm seeing this problem occasionally too.

I'm running 2.6.10

The patch you provided below can be made to apply but I get:
LD .tmp_vmlinux1
fs/built-in.o(.text+0xa0ed3): In function `linvfs_decode_fh':
: undefined reference to `find_exported_dentry'

I assume that since you say:

Btw, any chance you could
try XFS CVS (which is at 2.6.9) + the patch below instead of plain 2.6.9,
there have been various other fixes in the last months.


That not all the changes in XFS CVS have made it to 2.6.10?

Is there a 2.6.10 patch that I could apply? Or do you have any other suggestions.

David


Index: fs/xfs/xfs_vfsops.c
===================================================================
RCS file: /cvs/linux-2.6-xfs/fs/xfs/xfs_vfsops.c,v
retrieving revision 1.459
diff -u -p -r1.459 xfs_vfsops.c
--- fs/xfs/xfs_vfsops.c 15 Dec 2004 04:56:58 -0000 1.459
+++ fs/xfs/xfs_vfsops.c 16 Dec 2004 20:47:22 -0000
@@ -1581,7 +1581,7 @@ xfs_syncsub(
}

/*
- * xfs_vget - called by DMAPI to get vnode from file handle
+ * xfs_vget - called by DMAPI and NFSD to get vnode from file handle
*/
STATIC int
xfs_vget(
@@ -1623,7 +1623,7 @@ xfs_vget(
return XFS_ERROR(EIO);
}

- if (ip->i_d.di_mode == 0 || (igen && (ip->i_d.di_gen != igen))) {
+ if (ip->i_d.di_mode == 0 || ip->i_d.di_gen != igen) {
xfs_iput_new(ip, XFS_ILOCK_SHARED);
*vpp = NULL;
return XFS_ERROR(ENOENT);
Index: fs/xfs/linux-2.6/xfs_super.c
===================================================================
RCS file: /cvs/linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c,v
retrieving revision 1.321
diff -u -p -r1.321 xfs_super.c
--- fs/xfs/linux-2.6/xfs_super.c 9 Dec 2004 02:41:20 -0000 1.321
+++ fs/xfs/linux-2.6/xfs_super.c 16 Dec 2004 20:47:23 -0000
@@ -731,6 +731,39 @@ linvfs_get_dentry(
return result;
}

+STATIC struct dentry *
+linvfs_decode_fh(
+ struct super_block *sb,
+ __u32 *fh,
+ int fh_len,
+ int fileid_type,
+ int (*acceptable)(
+ void *context,
+ struct dentry *de),
+ void *context)
+{
+ __u32 parent[2];
+ parent[0] = parent[1] = 0;
+
+ if (fh_len < 2 || fileid_type > 2)
+ return NULL;
+
+ if (fileid_type == 2 && fh_len > 2) {
+ if (fh_len == 3) {
+ printk(KERN_WARNING
+ "XFS: detected filehandle without "
+ "parent inode generation information.");
+ return ERR_PTR(-ESTALE);
+ }
+
+ parent[0] = fh[2];
+ parent[1] = fh[3];
+ }
+
+ return find_exported_dentry(sb, fh, parent, acceptable, context);
+
+}
+
STATIC int
linvfs_show_options(
struct seq_file *m,
@@ -893,6 +926,7 @@ linvfs_get_sb(


STATIC struct export_operations linvfs_export_ops = {
+ .decode_fh = linvfs_decode_fh,
.get_parent = linvfs_get_parent,
.get_dentry = linvfs_get_dentry,
};
Index: include/linux/fs.h
===================================================================
RCS file: /cvs/linux-2.6-xfs/include/linux/fs.h,v
retrieving revision 1.11
diff -u -p -r1.11 fs.h
--- include/linux/fs.h 1 Oct 2004 15:10:15 -0000 1.11
+++ include/linux/fs.h 16 Dec 2004 20:47:25 -0000
@@ -1115,6 +1115,10 @@ struct export_operations {

};

+extern struct dentry *
+find_exported_dentry(struct super_block *sb, void *obj, void *parent,
+ int (*acceptable)(void *context, struct dentry *de),
+ void *context);

struct file_system_type {
const char *name;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/