]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ovl: use is_subdir() for testing if one thing is a subdir of another
authorNeilBrown <neil@brown.name>
Tue, 24 Feb 2026 22:16:58 +0000 (09:16 +1100)
committerChristian Brauner <brauner@kernel.org>
Mon, 9 Mar 2026 08:43:03 +0000 (09:43 +0100)
commit56c8fd738ed86667daa13c8a28fd1074f8a22cb7
tree54ec4289d3d4368997ad44cba225ff2f8fa9c135
parent8348278650bca7a51c274bdf898aa9a73ce4b67f
ovl: use is_subdir() for testing if one thing is a subdir of another

Rather than using lock_rename(), use the more obvious is_subdir() for
ensuring that neither upper nor workdir contain the other.
Also be explicit in the comment that the two directories cannot be the
same.

As this is a point-it-time sanity check and does not provide any
on-going guarantees, the removal of locking does not introduce any
interesting races.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: NeilBrown <neil@brown.name>
Link: https://patch.msgid.link/20260224222542.3458677-14-neilb@ownmail.net
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/overlayfs/super.c