]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/debugfs/inode.c
Merge branch 'waitid-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[mirror_ubuntu-bionic-kernel.git] / fs / debugfs / inode.c
index 77440e4aa9d4eded846e3223efadb3bb076c0e68..a0e4e2f7e0befb47c22f9d275e90c039457e1b86 100644 (file)
@@ -766,7 +766,7 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
 {
        int error;
        struct dentry *dentry = NULL, *trap;
-       const char *old_name;
+       struct name_snapshot old_name;
 
        trap = lock_rename(new_dir, old_dir);
        /* Source or destination directories don't exist? */
@@ -781,19 +781,19 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
        if (IS_ERR(dentry) || dentry == trap || d_really_is_positive(dentry))
                goto exit;
 
-       old_name = fsnotify_oldname_init(old_dentry->d_name.name);
+       take_dentry_name_snapshot(&old_name, old_dentry);
 
        error = simple_rename(d_inode(old_dir), old_dentry, d_inode(new_dir),
                              dentry, 0);
        if (error) {
-               fsnotify_oldname_free(old_name);
+               release_dentry_name_snapshot(&old_name);
                goto exit;
        }
        d_move(old_dentry, dentry);
-       fsnotify_move(d_inode(old_dir), d_inode(new_dir), old_name,
+       fsnotify_move(d_inode(old_dir), d_inode(new_dir), old_name.name,
                d_is_dir(old_dentry),
                NULL, old_dentry);
-       fsnotify_oldname_free(old_name);
+       release_dentry_name_snapshot(&old_name);
        unlock_rename(new_dir, old_dir);
        dput(dentry);
        return old_dentry;