From: Erez Zadok Date: Tue, 15 Apr 2008 23:49:51 +0000 (-0400) Subject: Unionfs: lock inode around calls to notify_change() X-Git-Tag: unionfs-2.3.3~9 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=8675026689a8ce287e5064f21e02f5dacbe19968;p=unionfs-2.6.19.y.git Unionfs: lock inode around calls to notify_change() Signed-off-by: Erez Zadok --- diff --git a/fs/unionfs/copyup.c b/fs/unionfs/copyup.c index a2ec4596434..02e909cc88b 100644 --- a/fs/unionfs/copyup.c +++ b/fs/unionfs/copyup.c @@ -135,6 +135,7 @@ static int copyup_permissions(struct super_block *sb, newattrs.ia_valid = ATTR_CTIME | ATTR_ATIME | ATTR_MTIME | ATTR_ATIME_SET | ATTR_MTIME_SET | ATTR_FORCE | ATTR_GID | ATTR_UID; + mutex_lock(&new_lower_dentry->d_inode->i_mutex); err = notify_change(new_lower_dentry, &newattrs); if (err) goto out; @@ -152,6 +153,7 @@ static int copyup_permissions(struct super_block *sb, } out: + mutex_unlock(&new_lower_dentry->d_inode->i_mutex); return err; } diff --git a/fs/unionfs/inode.c b/fs/unionfs/inode.c index c490303a6d3..04429a1281c 100644 --- a/fs/unionfs/inode.c +++ b/fs/unionfs/inode.c @@ -1022,7 +1022,9 @@ static int unionfs_setattr(struct dentry *dentry, struct iattr *ia) } /* notify the (possibly copied-up) lower inode */ + mutex_lock(&lower_dentry->d_inode->i_mutex); err = notify_change(lower_dentry, ia); + mutex_unlock(&lower_dentry->d_inode->i_mutex); if (err) goto out;