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