fs: rename the mountpoint should go through pseudorename branch

to avoid this type of error:
mount -t procfs /a/b
mv /a/b /
mv: rename failed: 88

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2020-09-15 23:13:53 +08:00 committed by Brennan Ashton
parent 8602e46d4a
commit 59fbd35609
1 changed files with 1 additions and 1 deletions

View File

@ -513,7 +513,7 @@ int rename(FAR const char *oldpath, FAR const char *newpath)
#ifndef CONFIG_DISABLE_MOUNTPOINT
/* Verify that the old inode is a valid mountpoint. */
if (INODE_IS_MOUNTPT(oldinode))
if (INODE_IS_MOUNTPT(oldinode) && *olddesc.relpath != '\0')
{
ret = mountptrename(oldpath, oldinode, olddesc.relpath, newpath);
}