Commit 65916a24 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] JFS fix for NFS on little-endian systems

From: Dave Kleikamp <shaggy@austin.ibm.com>

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.
parent b7e72582
...@@ -1439,14 +1439,18 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc ...@@ -1439,14 +1439,18 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc
struct dentry *jfs_get_parent(struct dentry *dentry) struct dentry *jfs_get_parent(struct dentry *dentry)
{ {
struct super_block *sb = dentry->d_inode->i_sb; struct super_block *sb = dentry->d_inode->i_sb;
struct dentry *parent = ERR_PTR(-EACCES); struct dentry *parent = ERR_PTR(-ENOENT);
struct inode *inode; 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 (inode) {
if (is_bad_inode(inode)) if (is_bad_inode(inode)) {
iput(inode); iput(inode);
else { parent = ERR_PTR(-EACCES);
} else {
parent = d_alloc_anon(inode); parent = d_alloc_anon(inode);
if (!parent) { if (!parent) {
parent = ERR_PTR(-ENOMEM); parent = ERR_PTR(-ENOMEM);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment