diff options
Diffstat (limited to 'fs/nfs')
-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(); |