Ext2FS: Assert that create_directory() is called with valid mode

This commit is contained in:
Andreas Kling 2021-01-23 16:39:31 +01:00
parent a85c61ad51
commit bfb254ed14
Notes: sideshowbarker 2024-07-18 22:55:43 +09:00

View file

@ -1439,11 +1439,7 @@ KResult Ext2FS::create_directory(InodeIdentifier parent_id, const String& name,
{
LOCKER(m_lock);
ASSERT(parent_id.fsid() == fsid());
// Fix up the mode to definitely be a directory.
// FIXME: This is a bit on the hackish side.
mode &= ~0170000;
mode |= 0040000;
ASSERT(is_directory(mode));
// NOTE: When creating a new directory, make the size 1 block.
// There's probably a better strategy here, but this works for now.