]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ecryptfs: add missing lock around notify_change
authorMiklos Szeredi <mszeredi@suse.cz>
Sun, 8 Jun 2008 08:56:53 +0000 (10:56 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 16 Jun 2008 20:19:50 +0000 (13:19 -0700)
upstream commit: 9c3580aa52195699065bc2d7242b1c7e3e6903fa

Callers of notify_change() need to hold i_mutex.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
fs/ecryptfs/inode.c

index e2386115210105ecbbb01376a7290d0dd4dbe107..af1b8c599fa554e114854721743b308d5f3bdf1a 100644 (file)
@@ -908,7 +908,9 @@ static int ecryptfs_setattr(struct dentry *dentry, struct iattr *ia)
        if (ia->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID))
                ia->ia_valid &= ~ATTR_MODE;
 
+       mutex_lock(&lower_dentry->d_inode->i_mutex);
        rc = notify_change(lower_dentry, ia);
+       mutex_unlock(&lower_dentry->d_inode->i_mutex);
 out:
        fsstack_copy_attr_all(inode, lower_inode, NULL);
        return rc;