]> git.ipfire.org Git - thirdparty/linux.git/commit
ovl: simplify gotos in ovl_rename()
authorNeilBrown <neil@brown.name>
Wed, 16 Jul 2025 00:44:19 +0000 (10:44 +1000)
committerChristian Brauner <brauner@kernel.org>
Fri, 18 Jul 2025 09:10:41 +0000 (11:10 +0200)
commit76342c9eb8e28f2e421ec7fb72bb2b9aa4d7dd77
tree9c3ea78508ed1db19cb54e42b7563931e16832f8
parente460bc4d012ce144376264609309b14b84b693ff
ovl: simplify gotos in ovl_rename()

Rather than having three separate goto label: out_unlock, out_dput_old,
and out_dput, make use of that fact that dput() happily accepts a NULL
pointer to reduce this to just one goto label: out_unlock.

olddentry and newdentry are initialised to NULL and only set once a
value dentry is found.  They are then dput() late in the function.

Suggested-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: NeilBrown <neil@brown.name>
Link: https://lore.kernel.org/20250716004725.1206467-9-neil@brown.name
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/overlayfs/dir.c