Unverified Commit 5f9ad16b authored by Tyler Hicks's avatar Tyler Hicks Committed by Christian Brauner
Browse files

ecryptfs: Fix improper mknod pairing of start_creating()/end_removing()



The ecryptfs_start_creating_dentry() function must be paired with the
end_creating() function. Fix ecryptfs_mknod() so that end_creating() is
properly called in the return path, instead of end_removing().

Fixes: f046fbb4 ("ecryptfs: use new start_creating/start_removing APIs")
Signed-off-by: default avatarTyler Hicks <code@tyhicks.com>
Link: https://patch.msgid.link/20251223194153.2818445-2-code@tyhicks.com


Reviewed-by: default avatarAmir Goldstein <amir73il@gmail.com>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 3dd57dde
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -584,7 +584,7 @@ ecryptfs_mknod(struct mnt_idmap *idmap, struct inode *dir,
	fsstack_copy_attr_times(dir, lower_dir);
	fsstack_copy_inode_size(dir, lower_dir);
out:
	end_removing(lower_dentry);
	end_creating(lower_dentry);
	if (d_really_is_negative(dentry))
		d_drop(dentry);
	return rc;