summaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfsfh.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-06-17 13:25:08 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-06-17 13:25:08 +0000
commit59223edaa18759982db0a8aced0e77457d10c68e (patch)
tree89354903b01fa0a447bffeefe00df3044495db2e /fs/nfsd/nfsfh.c
parentdb7d4daea91e105e3859cf461d7e53b9b77454b2 (diff)
Merge with Linux 2.3.6. Sorry, this isn't tested on silicon, I don't
have a MIPS box at hand.
Diffstat (limited to 'fs/nfsd/nfsfh.c')
-rw-r--r--fs/nfsd/nfsfh.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index 6f6b4a733..0c318e212 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -407,6 +407,9 @@ struct dentry * lookup_inode(kdev_t dev, ino_t dirino, ino_t ino)
sb = get_super(dev);
if (!sb)
goto out_page;
+ result = ERR_PTR(-ENOSYS);
+ if (!sb->s_op->read_inode) /* No working iget(), e.g. FAT */
+ goto out_page;
root = dget(sb->s_root);
root_ino = root->d_inode->i_ino; /* usually 2 */
@@ -433,7 +436,7 @@ struct dentry * lookup_inode(kdev_t dev, ino_t dirino, ino_t ino)
dir = iget(sb, dirino);
if (!dir)
goto out_root;
- dentry = d_alloc_root(dir, NULL);
+ dentry = d_alloc_root(dir);
if (!dentry)
goto out_iput;
@@ -528,7 +531,7 @@ dentry->d_parent->d_name.name, dentry->d_name.name, dentry->d_count,empty->ino);
* Add the parent to the dir cache before releasing the dentry,
* and check whether to save a copy of the dentry's path.
*/
- if (dentry != dentry->d_parent) {
+ if (!IS_ROOT(dentry)) {
struct dentry *parent = dget(dentry->d_parent);
if (add_to_fhcache(parent, NFSD_DIR_CACHE))
nfsd_nr_verified++;
@@ -1137,7 +1140,7 @@ check_type:
error = nfserr_stale;
dprintk("fh_verify: no root_squashed access.\n");
}
- } while ((tdentry != tdentry->d_parent));
+ } while (!IS_ROOT(tdentry));
if (exp->ex_dentry != tdentry) {
error = nfserr_stale;
printk("nfsd Security: %s/%s bad export.\n",