diff options
author | Tyler Hicks <tyhicks@linux.vnet.ibm.com> | 2011-04-29 16:26:27 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-04 09:49:22 -0800 |
commit | d298243d8b3e63554553a729aec6b9e1502ce00d (patch) | |
tree | 92004aa1f169dcfdaf9f1ab15091262d5767ae04 | |
parent | 12a9959bcc17eca2567447abfab2ca7f7ebac594 (diff) | |
download | lwn-d298243d8b3e63554553a729aec6b9e1502ce00d.tar.gz lwn-d298243d8b3e63554553a729aec6b9e1502ce00d.zip |
eCryptfs: Clear i_nlink in rmdir
commit 07850552b92b3637fa56767b5e460b4238014447 upstream.
eCryptfs wasn't clearing the eCryptfs inode's i_nlink after a successful
vfs_rmdir() on the lower directory. This resulted in the inode evict and
destroy paths to be missed.
https://bugs.launchpad.net/ecryptfs/+bug/723518
Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Signed-off-by: Colin King <colin.king@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/ecryptfs/inode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c index 79ae6a7b20a1..4434e8fcd2e7 100644 --- a/fs/ecryptfs/inode.c +++ b/fs/ecryptfs/inode.c @@ -575,6 +575,8 @@ static int ecryptfs_rmdir(struct inode *dir, struct dentry *dentry) dget(lower_dentry); rc = vfs_rmdir(lower_dir_dentry->d_inode, lower_dentry); dput(lower_dentry); + if (!rc && dentry->d_inode) + clear_nlink(dentry->d_inode); fsstack_copy_attr_times(dir, lower_dir_dentry->d_inode); dir->i_nlink = lower_dir_dentry->d_inode->i_nlink; unlock_dir(lower_dir_dentry); |