1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-04 17:47:36 +00:00

Kernel: Allow Ext2FS::flush_writes() to return ErrorOr<void>

This commit is contained in:
Zak-K-Abdi 2023-08-01 07:48:43 +01:00 committed by Sam Atkins
parent 28cda85f1f
commit abcf05801a
8 changed files with 26 additions and 12 deletions

View file

@ -662,7 +662,7 @@ void Ext2FS::flush_block_group_descriptor_table()
}
}
void Ext2FS::flush_writes()
ErrorOr<void> Ext2FS::flush_writes()
{
{
MutexLocker locker(m_lock);
@ -670,8 +670,7 @@ void Ext2FS::flush_writes()
auto result = flush_super_block();
if (result.is_error()) {
dbgln("Ext2FS[{}]::flush_writes(): Failed to write superblock: {}", fsid(), result.error());
// FIXME: We should handle this error.
VERIFY_NOT_REACHED();
return result.release_error();
}
m_super_block_dirty = false;
}
@ -708,7 +707,13 @@ void Ext2FS::flush_writes()
});
}
BlockBasedFileSystem::flush_writes();
auto result = BlockBasedFileSystem::flush_writes();
if (result.is_error()) {
dbgln("Ext2FS[{}]::flush_writes(): Failed to flush writes: {}", BlockBasedFileSystem::fsid(), result.error());
return result.release_error();
}
return {};
}
ErrorOr<NonnullRefPtr<Ext2FSInode>> Ext2FS::build_root_inode() const