]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ovl: change inode_lock to mutex_lock
authorShan Hai <shan.hai@oracle.com>
Tue, 1 Aug 2017 01:26:19 +0000 (09:26 +0800)
committerShan Hai <shan.hai@oracle.com>
Fri, 4 Aug 2017 05:54:50 +0000 (13:54 +0800)
Orabug: 26401569

Change the lock type in order to back port the patch to the current
kernel which uses mutex_lock instead of inode_lock.

Signed-off-by: Shan Hai <shan.hai@oracle.com>
Reviewed-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
fs/overlayfs/readdir.c

index 3f4db095d7b9f06918586533e00314947ea619f4..e7e76f574af78dd181b3f614bb5ab66f2fe55ac3 100644 (file)
@@ -625,7 +625,7 @@ static void ovl_workdir_cleanup_recurse(struct path *path, int level)
        if (err)
                goto out;
 
-       inode_lock_nested(dir, I_MUTEX_PARENT);
+       mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT);
        list_for_each_entry(p, &list, l_node) {
                struct dentry *dentry;
 
@@ -642,7 +642,7 @@ static void ovl_workdir_cleanup_recurse(struct path *path, int level)
                        ovl_workdir_cleanup(dir, path->mnt, dentry, level);
                dput(dentry);
        }
-       inode_unlock(dir);
+       mutex_unlock(&dir->i_mutex);
 out:
        ovl_cache_free(&list);
 }
@@ -661,9 +661,9 @@ void ovl_workdir_cleanup(struct inode *dir, struct vfsmount *mnt,
        if (err) {
                struct path path = { .mnt = mnt, .dentry = dentry };
 
-               inode_unlock(dir);
+               mutex_unlock(&dir->i_mutex);
                ovl_workdir_cleanup_recurse(&path, level + 1);
-               inode_lock_nested(dir, I_MUTEX_PARENT);
+               mutex_lock_nested(&dir->i_mutex, I_MUTEX_PARENT);
                ovl_cleanup(dir, dentry);
        }
 }