diff --git a/fs/namei.c b/fs/namei.c index 84a0e0b0111c..ff843007ca94 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -5013,7 +5013,7 @@ int vfs_rename(struct renamedata *rd) struct name_snapshot old_name; bool lock_old_subdir, lock_new_subdir; - if (source == target) + if (source == target || old_dir == target) return 0; error = may_delete(rd->old_mnt_idmap, old_dir, old_dentry, is_dir);