summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2008-04-29 00:59:48 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 08:06:07 -0700
commit9c3580aa52195699065bc2d7242b1c7e3e6903fa (patch)
tree975320d4a2369ebffadf7273bb8f86377d03445f /fs
parent18d1dbf1d401e8f9d74cf1cf799fdb19cff150c6 (diff)
downloadkernel-crypto-9c3580aa52195699065bc2d7242b1c7e3e6903fa.tar.gz
kernel-crypto-9c3580aa52195699065bc2d7242b1c7e3e6903fa.tar.xz
kernel-crypto-9c3580aa52195699065bc2d7242b1c7e3e6903fa.zip
ecryptfs: add missing lock around notify_change
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/ecryptfs/inode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
index a7d5d7d2b2a..1623ebf25e5 100644
--- a/fs/ecryptfs/inode.c
+++ b/fs/ecryptfs/inode.c
@@ -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;