[PATCH] Problems with NFS while running SpecSFS with JFSfilesystem and 2.6 kernel.

From: Dave Kleikamp
Date: Wed Dec 17 2003 - 15:12:32 EST


On Mon, 2003-12-15 at 08:21, Jose R. Santos wrote:
>
> Can anybody provide me with some tips as to how to debug this a bit further?
> Really want to figure out if this is a NFS bug or a JFS one.

After Jose debugged the problem down to the routine jfs_get_parent, we
were able to find the problem. I believe it only affects users of
NFS-exported JFS file systems on big-endian hardware.

The problem was a missing le32_to_cpu macro. The patch also fixes a
return code to be more consistent other implementations of get_parent.

Linus, Andrew,
We're likely to see the problem on ppc running NFS. Does this patch
meet the criteria for 2.6.0?

===== fs/jfs/namei.c 1.35 vs edited =====
--- 1.35/fs/jfs/namei.c Thu Oct 30 09:31:08 2003
+++ edited/fs/jfs/namei.c Wed Dec 17 12:34:10 2003
@@ -1439,14 +1439,18 @@
struct dentry *jfs_get_parent(struct dentry *dentry)
{
struct super_block *sb = dentry->d_inode->i_sb;
- struct dentry *parent = ERR_PTR(-EACCES);
+ struct dentry *parent = ERR_PTR(-ENOENT);
struct inode *inode;
+ unsigned long parent_ino;

- inode = iget(sb, JFS_IP(dentry->d_inode)->i_dtroot.header.idotdot);
+ parent_ino =
+ le32_to_cpu(JFS_IP(dentry->d_inode)->i_dtroot.header.idotdot);
+ inode = iget(sb, parent_ino);
if (inode) {
- if (is_bad_inode(inode))
+ if (is_bad_inode(inode)) {
iput(inode);
- else {
+ parent = ERR_PTR(-EACCES);
+ } else {
parent = d_alloc_anon(inode);
if (!parent) {
parent = ERR_PTR(-ENOMEM);

--
David Kleikamp
IBM Linux Technology Center

-
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/