Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346631
b: refs/heads/master
c: 1f01845
h: refs/heads/master
i:
  346629: b273dad
  346627: 2e357fe
  346623: ba53838
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Dec 14, 2012
1 parent 0efe46f commit 5e16bd3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eed9935745cc44071043ec8c4cde64c820b5c601
refs/heads/master: 1f018458b30b0d5c535c94e577aa0acbb92e1395
11 changes: 6 additions & 5 deletions trunk/fs/nfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1155,11 +1155,14 @@ static int nfs_dentry_delete(const struct dentry *dentry)

}

/* Ensure that we revalidate inode->i_nlink */
static void nfs_drop_nlink(struct inode *inode)
{
spin_lock(&inode->i_lock);
if (inode->i_nlink > 0)
drop_nlink(inode);
/* drop the inode if we're reasonably sure this is the last link */
if (inode->i_nlink == 1)
clear_nlink(inode);
NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR;
spin_unlock(&inode->i_lock);
}

Expand All @@ -1174,8 +1177,8 @@ static void nfs_dentry_iput(struct dentry *dentry, struct inode *inode)
NFS_I(inode)->cache_validity |= NFS_INO_INVALID_DATA;

if (dentry->d_flags & DCACHE_NFSFS_RENAMED) {
drop_nlink(inode);
nfs_complete_unlink(dentry, inode);
nfs_drop_nlink(inode);
}
iput(inode);
}
Expand Down Expand Up @@ -1646,10 +1649,8 @@ static int nfs_safe_remove(struct dentry *dentry)
if (inode != NULL) {
NFS_PROTO(inode)->return_delegation(inode);
error = NFS_PROTO(dir)->remove(dir, &dentry->d_name);
/* The VFS may want to delete this inode */
if (error == 0)
nfs_drop_nlink(inode);
nfs_mark_for_revalidate(inode);
} else
error = NFS_PROTO(dir)->remove(dir, &dentry->d_name);
if (error == -ENOENT)
Expand Down

0 comments on commit 5e16bd3

Please sign in to comment.