Loading fs/namei.c +14 −11 Original line number Diff line number Diff line Loading @@ -3006,7 +3006,7 @@ static int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry, static int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry) { struct inode *target; struct inode *target = new_dentry->d_inode; int error; error = security_inode_rename(old_dir, old_dentry, new_dir, new_dentry); Loading @@ -3014,19 +3014,22 @@ static int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry, return error; dget(new_dentry); target = new_dentry->d_inode; if (target) mutex_lock(&target->i_mutex); if (d_mountpoint(old_dentry)||d_mountpoint(new_dentry)) error = -EBUSY; else if (d_mountpoint(old_dentry)||d_mountpoint(new_dentry)) goto out; error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry); if (!error) { if (error) goto out; if (target) dont_mount(new_dentry); if (!(old_dir->i_sb->s_type->fs_flags & FS_RENAME_DOES_D_MOVE)) d_move(old_dentry, new_dentry); } out: if (target) mutex_unlock(&target->i_mutex); dput(new_dentry); Loading Loading
fs/namei.c +14 −11 Original line number Diff line number Diff line Loading @@ -3006,7 +3006,7 @@ static int vfs_rename_dir(struct inode *old_dir, struct dentry *old_dentry, static int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, struct dentry *new_dentry) { struct inode *target; struct inode *target = new_dentry->d_inode; int error; error = security_inode_rename(old_dir, old_dentry, new_dir, new_dentry); Loading @@ -3014,19 +3014,22 @@ static int vfs_rename_other(struct inode *old_dir, struct dentry *old_dentry, return error; dget(new_dentry); target = new_dentry->d_inode; if (target) mutex_lock(&target->i_mutex); if (d_mountpoint(old_dentry)||d_mountpoint(new_dentry)) error = -EBUSY; else if (d_mountpoint(old_dentry)||d_mountpoint(new_dentry)) goto out; error = old_dir->i_op->rename(old_dir, old_dentry, new_dir, new_dentry); if (!error) { if (error) goto out; if (target) dont_mount(new_dentry); if (!(old_dir->i_sb->s_type->fs_flags & FS_RENAME_DOES_D_MOVE)) d_move(old_dentry, new_dentry); } out: if (target) mutex_unlock(&target->i_mutex); dput(new_dentry); Loading