]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
eCryptfs: Clear i_nlink in rmdir
authorTyler Hicks <tyhicks@linux.vnet.ibm.com>
Fri, 29 Apr 2011 21:26:27 +0000 (16:26 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Jun 2011 00:32:31 +0000 (09:32 +0900)
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: Greg Kroah-Hartman <gregkh@suse.de>
fs/ecryptfs/inode.c

index 4d4cc6a90cd57f18b330674f8e5320205cc2a5e6..94ab3c06317a87283094b18f06ab466064ac8817 100644 (file)
@@ -527,6 +527,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);