Ext2FS: Oops, fix wrong ENOSPC in create_inode()

This commit is contained in:
Andreas Kling 2019-09-22 18:44:05 +02:00
parent bff59eff4b
commit bd7c38e7b6
Notes: sideshowbarker 2024-07-19 12:00:26 +09:00

View File

@ -1190,7 +1190,7 @@ RefPtr<Inode> Ext2FS::create_inode(InodeIdentifier parent_id, const String& name
#endif
auto needed_blocks = ceil_div(size, block_size());
if ((size_t)needed_blocks < super_block().s_free_blocks_count) {
if ((size_t)needed_blocks > super_block().s_free_blocks_count) {
dbg() << "Ext2FS: create_inode: not enough free blocks";
error = -ENOSPC;
return {};