summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/super.c
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2017-06-21 08:28:51 -0400
committerMiklos Szeredi <mszeredi@redhat.com>2017-07-04 16:03:16 -0400
commita015dafcaf5b0316654a39bc598a76804595af90 (patch)
tree1a7e80fd1904519c9642b6549ad9f32bd5ab4d96 /fs/overlayfs/super.c
parent13c72075ac9f5a5cf3f61c85adaafffe48a6f797 (diff)
ovl: use ovl_inode mutex to synchronize concurrent copy up
Use the new ovl_inode mutex to synchonize concurrent copy up instead of the super block copy up workqueue. Moving the synchronization object from the overlay dentry to the overlay inode is needed for synchonizing concurrent copy up of lower hardlinks to the same upper inode. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/super.c')
-rw-r--r--fs/overlayfs/super.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 7c7b946b063f..b0d539af1fad 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -173,6 +173,7 @@ static struct inode *ovl_alloc_inode(struct super_block *sb)
173 oi->flags = 0; 173 oi->flags = 0;
174 oi->__upperdentry = NULL; 174 oi->__upperdentry = NULL;
175 oi->lower = NULL; 175 oi->lower = NULL;
176 mutex_init(&oi->lock);
176 177
177 return &oi->vfs_inode; 178 return &oi->vfs_inode;
178} 179}
@@ -190,6 +191,7 @@ static void ovl_destroy_inode(struct inode *inode)
190 191
191 dput(oi->__upperdentry); 192 dput(oi->__upperdentry);
192 kfree(oi->redirect); 193 kfree(oi->redirect);
194 mutex_destroy(&oi->lock);
193 195
194 call_rcu(&inode->i_rcu, ovl_i_callback); 196 call_rcu(&inode->i_rcu, ovl_i_callback);
195} 197}
@@ -782,7 +784,6 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
782 if (!ufs) 784 if (!ufs)
783 goto out; 785 goto out;
784 786
785 init_waitqueue_head(&ufs->copyup_wq);
786 ufs->config.redirect_dir = ovl_redirect_dir_def; 787 ufs->config.redirect_dir = ovl_redirect_dir_def;
787 err = ovl_parse_opt((char *) data, &ufs->config); 788 err = ovl_parse_opt((char *) data, &ufs->config);
788 if (err) 789 if (err)