diff options
-rw-r--r-- | fs/nfs/dir.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index b1940660502f..d6ec1c85995a 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -870,6 +870,14 @@ static int nfs_dentry_delete(struct dentry *dentry) | |||
870 | 870 | ||
871 | } | 871 | } |
872 | 872 | ||
873 | static void nfs_drop_nlink(struct inode *inode) | ||
874 | { | ||
875 | spin_lock(&inode->i_lock); | ||
876 | if (inode->i_nlink > 0) | ||
877 | drop_nlink(inode); | ||
878 | spin_unlock(&inode->i_lock); | ||
879 | } | ||
880 | |||
873 | /* | 881 | /* |
874 | * Called when the dentry loses inode. | 882 | * Called when the dentry loses inode. |
875 | * We use it to clean up silly-renamed files. | 883 | * We use it to clean up silly-renamed files. |
@@ -1420,7 +1428,7 @@ static int nfs_safe_remove(struct dentry *dentry) | |||
1420 | error = NFS_PROTO(dir)->remove(dir, &dentry->d_name); | 1428 | error = NFS_PROTO(dir)->remove(dir, &dentry->d_name); |
1421 | /* The VFS may want to delete this inode */ | 1429 | /* The VFS may want to delete this inode */ |
1422 | if (error == 0) | 1430 | if (error == 0) |
1423 | drop_nlink(inode); | 1431 | nfs_drop_nlink(inode); |
1424 | nfs_mark_for_revalidate(inode); | 1432 | nfs_mark_for_revalidate(inode); |
1425 | } else | 1433 | } else |
1426 | error = NFS_PROTO(dir)->remove(dir, &dentry->d_name); | 1434 | error = NFS_PROTO(dir)->remove(dir, &dentry->d_name); |
@@ -1647,7 +1655,7 @@ static int nfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1647 | /* dentry still busy? */ | 1655 | /* dentry still busy? */ |
1648 | goto out; | 1656 | goto out; |
1649 | } else | 1657 | } else |
1650 | drop_nlink(new_inode); | 1658 | nfs_drop_nlink(new_inode); |
1651 | 1659 | ||
1652 | go_ahead: | 1660 | go_ahead: |
1653 | /* | 1661 | /* |