diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-10-27 22:12:42 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-10-27 22:12:42 -0400 |
commit | cf809556149f076b7a020c10e066b2b96e79b6a1 (patch) | |
tree | 714d3e58b4fe5af9b144c735601946949b217820 /fs | |
parent | 516a6af641bb50c608329a5bd751acd0d65cc4ab (diff) |
NFS: Ensure that nfs_link() instantiates the dentry correctly
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfs/dir.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index ce8f77dadff9..8272ed3fc707 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -1432,17 +1432,14 @@ nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) | |||
1432 | old_dentry->d_parent->d_name.name, old_dentry->d_name.name, | 1432 | old_dentry->d_parent->d_name.name, old_dentry->d_name.name, |
1433 | dentry->d_parent->d_name.name, dentry->d_name.name); | 1433 | dentry->d_parent->d_name.name, dentry->d_name.name); |
1434 | 1434 | ||
1435 | /* | ||
1436 | * Drop the dentry in advance to force a new lookup. | ||
1437 | * Since nfs_proc_link doesn't return a file handle, | ||
1438 | * we can't use the existing dentry. | ||
1439 | */ | ||
1440 | lock_kernel(); | 1435 | lock_kernel(); |
1441 | d_drop(dentry); | ||
1442 | |||
1443 | nfs_begin_data_update(dir); | 1436 | nfs_begin_data_update(dir); |
1444 | nfs_begin_data_update(inode); | 1437 | nfs_begin_data_update(inode); |
1445 | error = NFS_PROTO(dir)->link(inode, dir, &dentry->d_name); | 1438 | error = NFS_PROTO(dir)->link(inode, dir, &dentry->d_name); |
1439 | if (error == 0) { | ||
1440 | atomic_inc(&inode->i_count); | ||
1441 | d_instantiate(dentry, inode); | ||
1442 | } | ||
1446 | nfs_end_data_update(inode); | 1443 | nfs_end_data_update(inode); |
1447 | nfs_end_data_update(dir); | 1444 | nfs_end_data_update(dir); |
1448 | unlock_kernel(); | 1445 | unlock_kernel(); |