diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-08 13:50:54 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-08 13:50:54 -0400 |
| commit | b8d4c1f9f48e344fe1d6e6ffae01d4b31bf0aac0 (patch) | |
| tree | 24685a7b0ebf8af0ff55f1384e0be125aa29da47 /fs/debugfs | |
| parent | 090a81d8766e21d33ab3e4d24e6c8e5eedf086dd (diff) | |
| parent | 49d31c2f389acfe83417083e1208422b4091cd9e (diff) | |
Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull misc filesystem updates from Al Viro:
"Assorted normal VFS / filesystems stuff..."
* 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
dentry name snapshots
Make statfs properly return read-only state after emergency remount
fs/dcache: init in_lookup_hashtable
minix: Deinline get_block, save 2691 bytes
fs: Reorder inode_owner_or_capable() to avoid needless
fs: warn in case userspace lied about modprobe return
Diffstat (limited to 'fs/debugfs')
| -rw-r--r-- | fs/debugfs/inode.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c index 77440e4aa9d4..a0e4e2f7e0be 100644 --- a/fs/debugfs/inode.c +++ b/fs/debugfs/inode.c | |||
| @@ -766,7 +766,7 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, | |||
| 766 | { | 766 | { |
| 767 | int error; | 767 | int error; |
| 768 | struct dentry *dentry = NULL, *trap; | 768 | struct dentry *dentry = NULL, *trap; |
| 769 | const char *old_name; | 769 | struct name_snapshot old_name; |
| 770 | 770 | ||
| 771 | trap = lock_rename(new_dir, old_dir); | 771 | trap = lock_rename(new_dir, old_dir); |
| 772 | /* Source or destination directories don't exist? */ | 772 | /* Source or destination directories don't exist? */ |
| @@ -781,19 +781,19 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry, | |||
| 781 | if (IS_ERR(dentry) || dentry == trap || d_really_is_positive(dentry)) | 781 | if (IS_ERR(dentry) || dentry == trap || d_really_is_positive(dentry)) |
| 782 | goto exit; | 782 | goto exit; |
| 783 | 783 | ||
| 784 | old_name = fsnotify_oldname_init(old_dentry->d_name.name); | 784 | take_dentry_name_snapshot(&old_name, old_dentry); |
| 785 | 785 | ||
| 786 | error = simple_rename(d_inode(old_dir), old_dentry, d_inode(new_dir), | 786 | error = simple_rename(d_inode(old_dir), old_dentry, d_inode(new_dir), |
| 787 | dentry, 0); | 787 | dentry, 0); |
| 788 | if (error) { | 788 | if (error) { |
| 789 | fsnotify_oldname_free(old_name); | 789 | release_dentry_name_snapshot(&old_name); |
| 790 | goto exit; | 790 | goto exit; |
| 791 | } | 791 | } |
| 792 | d_move(old_dentry, dentry); | 792 | d_move(old_dentry, dentry); |
| 793 | fsnotify_move(d_inode(old_dir), d_inode(new_dir), old_name, | 793 | fsnotify_move(d_inode(old_dir), d_inode(new_dir), old_name.name, |
| 794 | d_is_dir(old_dentry), | 794 | d_is_dir(old_dentry), |
| 795 | NULL, old_dentry); | 795 | NULL, old_dentry); |
| 796 | fsnotify_oldname_free(old_name); | 796 | release_dentry_name_snapshot(&old_name); |
| 797 | unlock_rename(new_dir, old_dir); | 797 | unlock_rename(new_dir, old_dir); |
| 798 | dput(dentry); | 798 | dput(dentry); |
| 799 | return old_dentry; | 799 | return old_dentry; |
