Skip to content

Commit 4313e35

Browse files
author
Al Viro
committed
ecryptfs: get rid of pointless dget/dput in ->symlink() and ->link()
calls in ->unlink(), ->rmdir() and ->rename() make sense - we want to prevent the underlying dentries going negative there. In ->symlink() and ->link() they are absolutely pointless. Signed-off-by: Al Viro <[email protected]>
1 parent a38fd87 commit 4313e35

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

fs/ecryptfs/inode.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,6 @@ static int ecryptfs_link(struct dentry *old_dentry, struct inode *dir,
437437
file_size_save = i_size_read(d_inode(old_dentry));
438438
lower_old_dentry = ecryptfs_dentry_to_lower(old_dentry);
439439
lower_new_dentry = ecryptfs_dentry_to_lower(new_dentry);
440-
dget(lower_old_dentry);
441-
dget(lower_new_dentry);
442440
lower_dir_dentry = lock_parent(lower_new_dentry);
443441
rc = vfs_link(lower_old_dentry, &init_user_ns,
444442
d_inode(lower_dir_dentry), lower_new_dentry, NULL);
@@ -454,8 +452,6 @@ static int ecryptfs_link(struct dentry *old_dentry, struct inode *dir,
454452
i_size_write(d_inode(new_dentry), file_size_save);
455453
out_lock:
456454
unlock_dir(lower_dir_dentry);
457-
dput(lower_new_dentry);
458-
dput(lower_old_dentry);
459455
return rc;
460456
}
461457

@@ -476,7 +472,6 @@ static int ecryptfs_symlink(struct user_namespace *mnt_userns,
476472
struct ecryptfs_mount_crypt_stat *mount_crypt_stat = NULL;
477473

478474
lower_dentry = ecryptfs_dentry_to_lower(dentry);
479-
dget(lower_dentry);
480475
lower_dir_dentry = lock_parent(lower_dentry);
481476
mount_crypt_stat = &ecryptfs_superblock_to_private(
482477
dir->i_sb)->mount_crypt_stat;
@@ -498,7 +493,6 @@ static int ecryptfs_symlink(struct user_namespace *mnt_userns,
498493
fsstack_copy_inode_size(dir, d_inode(lower_dir_dentry));
499494
out_lock:
500495
unlock_dir(lower_dir_dentry);
501-
dput(lower_dentry);
502496
if (d_really_is_negative(dentry))
503497
d_drop(dentry);
504498
return rc;

0 commit comments

Comments
 (0)