diff -urN 2.2.19pre3/fs/nfsd/nfsfh.c nfsd/fs/nfsd/nfsfh.c --- 2.2.19pre3/fs/nfsd/nfsfh.c Mon Dec 11 16:58:01 2000 +++ nfsd/fs/nfsd/nfsfh.c Sun Dec 24 16:54:36 2000 @@ -183,7 +183,6 @@ if (!(target->d_flags & DCACHE_NFSD_DISCONNECTED)) printk("nfsd: d_splice with non-DISCONNECTED target: %s/%s\n", parent->d_name.name, name->name); #endif - name->hash = full_name_hash(name->name, name->len); tdentry = d_alloc(parent, name); if (tdentry == NULL) return -ENOMEM; @@ -275,7 +274,6 @@ struct qstr qs; char namebuf[256]; struct list_head *lp; - struct dentry *tmp; /* child is an IS_ROOT (anonymous) dentry, but it is hypothesised that * it should be a child of parent. * We see if we can find a name and, if we can - splice it in. @@ -295,8 +293,8 @@ * parent by a lookup. In this case return that dentry. * caller must notice and act accordingly */ - for (lp = child->d_inode->i_dentry.next; lp != &child->d_inode->i_dentry ; lp=lp->next) { - tmp = list_entry(lp,struct dentry, d_alias); + list_for_each(lp, &child->d_inode->i_dentry) { + struct dentry *tmp = list_entry(lp,struct dentry, d_alias); if (tmp->d_parent == parent) { child = dget(tmp); goto out; @@ -308,12 +306,12 @@ err = get_ino_name(parent, &qs, child->d_inode->i_ino); if (err) goto out; - tmp = d_lookup(parent, &qs); - if (tmp) { + + /* find_inode_number calculates the name hash as a side effect */ + if (find_inode_number(parent, &qs) != 0) { /* Now that IS odd. I wonder what it means... */ err = -EEXIST; printk("nfsd-fh: found a name that I didn't expect: %s/%s\n", parent->d_name.name, qs.name); - dput(tmp); goto out; } err = d_splice(child, parent, &qs);