Kernel: Cleanup hardlink creation
This commit is contained in:
parent
f994210927
commit
16a5a234c1
|
@ -569,9 +569,7 @@ done:
|
||||||
{
|
{
|
||||||
ASSERT(this->mode().ifdir());
|
ASSERT(this->mode().ifdir());
|
||||||
ASSERT(!inode->mode().ifdir());
|
ASSERT(!inode->mode().ifdir());
|
||||||
|
ASSERT(&m_fs == inode->filesystem());
|
||||||
if (&m_fs != inode->filesystem())
|
|
||||||
return BAN::Error::from_errno(EXDEV);
|
|
||||||
|
|
||||||
if (!find_inode_impl(name).is_error())
|
if (!find_inode_impl(name).is_error())
|
||||||
return BAN::Error::from_errno(EEXIST);
|
return BAN::Error::from_errno(EEXIST);
|
||||||
|
|
|
@ -107,6 +107,8 @@ namespace Kernel
|
||||||
return BAN::Error::from_errno(ENOTDIR);
|
return BAN::Error::from_errno(ENOTDIR);
|
||||||
if (inode->mode().ifdir())
|
if (inode->mode().ifdir())
|
||||||
return BAN::Error::from_errno(EINVAL);
|
return BAN::Error::from_errno(EINVAL);
|
||||||
|
if (this->filesystem() != inode->filesystem())
|
||||||
|
return BAN::Error::from_errno(EXDEV);
|
||||||
if (auto* fs = filesystem(); fs && (fs->flag() & ST_RDONLY))
|
if (auto* fs = filesystem(); fs && (fs->flag() & ST_RDONLY))
|
||||||
return BAN::Error::from_errno(EROFS);
|
return BAN::Error::from_errno(EROFS);
|
||||||
return link_inode_impl(name, inode);
|
return link_inode_impl(name, inode);
|
||||||
|
|
Loading…
Reference in New Issue