diff -uprN linux/fs/nfsd/vfs.c linux-2.4.20/fs/nfsd/vfs.c
--- linux/fs/nfsd/vfs.c 2002-11-29 05:23:15.000000000 +0530
-+++ linux-2.4.20/fs/nfsd/vfs.c 2003-09-12 19:23:13.000000000 +0530
-@@ -77,6 +77,132 @@ struct raparms {
++++ linux-2.4.20/fs/nfsd/vfs.c 2003-09-13 17:31:21.000000000 +0530
+@@ -77,6 +77,133 @@ struct raparms {
static struct raparms * raparml;
static struct raparms * raparm_cache;
+ struct nameidata new_nd = { .dentry = tdentry, .last = ndentry->d_name};
+ struct inode_operations *op = old_nd.dentry->d_inode->i_op;
+ err = op->rename_raw(&old_nd, &new_nd);
++ d_move(odentry, ndentry);
+
+ return err;
+}
/*
* Look up one component of a pathname.
* N.B. After this call _both_ fhp and resfh need an fh_put
-@@ -300,7 +426,10 @@ nfsd_setattr(struct svc_rqst *rqstp, str
+@@ -300,7 +427,10 @@ nfsd_setattr(struct svc_rqst *rqstp, str
}
err = nfserr_notsync;
if (!check_guard || guardtime == inode->i_ctime) {
err = nfserrno(err);
}
if (size_change) {
-@@ -473,6 +602,15 @@ nfsd_open(struct svc_rqst *rqstp, struct
+@@ -473,6 +603,15 @@ nfsd_open(struct svc_rqst *rqstp, struct
filp->f_mode = FMODE_READ;
}
err = 0;
if (filp->f_op && filp->f_op->open) {
err = filp->f_op->open(inode, filp);
-@@ -487,7 +625,11 @@ nfsd_open(struct svc_rqst *rqstp, struct
+@@ -487,7 +626,11 @@ nfsd_open(struct svc_rqst *rqstp, struct
atomic_dec(&filp->f_count);
}
}
if (err)
err = nfserrno(err);
out:
-@@ -818,7 +960,7 @@ nfsd_create(struct svc_rqst *rqstp, stru
+@@ -818,7 +961,7 @@ nfsd_create(struct svc_rqst *rqstp, stru
{
struct dentry *dentry, *dchild;
struct inode *dirp;
err = nfserr_perm;
if (!flen)
-@@ -834,8 +976,24 @@ nfsd_create(struct svc_rqst *rqstp, stru
+@@ -834,8 +977,24 @@ nfsd_create(struct svc_rqst *rqstp, stru
dentry = fhp->fh_dentry;
dirp = dentry->d_inode;
goto out;
/*
* Check whether the response file handle has been verified yet.
-@@ -868,10 +1026,12 @@ nfsd_create(struct svc_rqst *rqstp, stru
+@@ -868,10 +1027,12 @@ nfsd_create(struct svc_rqst *rqstp, stru
* Make sure the child dentry is still negative ...
*/
err = nfserr_exist;
}
if (!(iap->ia_valid & ATTR_MODE))
-@@ -887,13 +1047,15 @@ nfsd_create(struct svc_rqst *rqstp, stru
+@@ -887,13 +1048,15 @@ nfsd_create(struct svc_rqst *rqstp, stru
err = vfs_create(dirp, dchild, iap->ia_mode);
break;
case S_IFDIR:
break;
default:
printk("nfsd: bad file type %o in nfsd_create\n", type);
-@@ -962,7 +1124,10 @@ nfsd_create_v3(struct svc_rqst *rqstp, s
+@@ -962,7 +1125,10 @@ nfsd_create_v3(struct svc_rqst *rqstp, s
/* Get all the sanity checks out of the way before
* we lock the parent. */
err = nfserr_notdir;
goto out;
fh_lock(fhp);
-@@ -1013,6 +1178,8 @@ nfsd_create_v3(struct svc_rqst *rqstp, s
+@@ -1013,6 +1179,8 @@ nfsd_create_v3(struct svc_rqst *rqstp, s
case NFS3_CREATE_GUARDED:
err = nfserr_exist;
}
goto out;
}
-@@ -1119,7 +1286,7 @@ nfsd_symlink(struct svc_rqst *rqstp, str
+@@ -1119,7 +1287,7 @@ nfsd_symlink(struct svc_rqst *rqstp, str
struct iattr *iap)
{
struct dentry *dentry, *dnew;
err = nfserr_noent;
if (!flen || !plen)
-@@ -1133,12 +1300,18 @@ nfsd_symlink(struct svc_rqst *rqstp, str
+@@ -1133,12 +1301,18 @@ nfsd_symlink(struct svc_rqst *rqstp, str
goto out;
fh_lock(fhp);
dentry = fhp->fh_dentry;
if (!err) {
if (EX_ISSYNC(fhp->fh_export))
nfsd_sync_dir(dentry);
-@@ -1148,7 +1321,10 @@ nfsd_symlink(struct svc_rqst *rqstp, str
+@@ -1148,7 +1322,10 @@ nfsd_symlink(struct svc_rqst *rqstp, str
iap->ia_valid |= ATTR_CTIME;
iap->ia_mode = (iap->ia_mode&S_IALLUGO)
| S_IFLNK;
if (!err && EX_ISSYNC(fhp->fh_export))
write_inode_now(dentry->d_inode, 1);
}
-@@ -1206,7 +1382,10 @@ nfsd_link(struct svc_rqst *rqstp, struct
+@@ -1206,7 +1383,10 @@ nfsd_link(struct svc_rqst *rqstp, struct
dold = tfhp->fh_dentry;
dest = dold->d_inode;
if (!err) {
if (EX_ISSYNC(ffhp->fh_export)) {
nfsd_sync_dir(ddir);
-@@ -1291,7 +1470,10 @@ nfsd_rename(struct svc_rqst *rqstp, stru
+@@ -1291,7 +1471,10 @@ nfsd_rename(struct svc_rqst *rqstp, stru
err = nfserr_perm;
} else
#endif
if (!err && EX_ISSYNC(tfhp->fh_export)) {
nfsd_sync_dir(tdentry);
nfsd_sync_dir(fdentry);
-@@ -1312,7 +1494,7 @@ nfsd_rename(struct svc_rqst *rqstp, stru
+@@ -1312,7 +1495,7 @@ nfsd_rename(struct svc_rqst *rqstp, stru
fill_post_wcc(tfhp);
double_up(&tdir->i_sem, &fdir->i_sem);
ffhp->fh_locked = tfhp->fh_locked = 0;
out:
return err;
}
-@@ -1358,9 +1540,15 @@ nfsd_unlink(struct svc_rqst *rqstp, stru
+@@ -1358,9 +1541,15 @@ nfsd_unlink(struct svc_rqst *rqstp, stru
err = nfserr_perm;
} else
#endif