On Fri Mar 14 12:45:04 2025 +0000, Jinoh Kang wrote:
Even if `is_dir == 1`, we still need to check the parent directories since, even if directories cannot be hardlinked, they can still be bind-mounted. For example, if `/var/lib/foo/dir1` is bind-mounted to `/home/user/dir1`, renaming the former to the latter would succeed without doing anything even if `/var/lib/foo` and `/home/user` are completely different directories. Such renaming should fail, but we're skipping the stat check entirely so the code will simply assume the same dentry (when it's not) and let it pass.
On second thought, actually such rename would still be no-op even if we got to the the codepath below.