瀏覽代碼

Ext2FS: Oops, fix forgotten assignment in Ext2FSInode::resize()

If the inode's block list cache is empty, we forgot to assign the
result of computing the block list. The fact that this worked anyway
makes me wonder when we actually don't have a cache..

Thanks to szyszkienty for spotting this! :^)
Andreas Kling 4 年之前
父節點
當前提交
3e3a72f2a2
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Kernel/FileSystem/Ext2FileSystem.cpp

+ 1 - 1
Kernel/FileSystem/Ext2FileSystem.cpp

@@ -776,7 +776,7 @@ KResult Ext2FSInode::resize(u64 new_size)
     if (!m_block_list.is_empty())
     if (!m_block_list.is_empty())
         block_list = m_block_list;
         block_list = m_block_list;
     else
     else
-        fs().block_list_for_inode(m_raw_inode);
+        block_list = fs().block_list_for_inode(m_raw_inode);
 
 
     if (blocks_needed_after > blocks_needed_before) {
     if (blocks_needed_after > blocks_needed_before) {
         auto new_blocks = fs().allocate_blocks(fs().group_index_from_inode(index()), blocks_needed_after - blocks_needed_before);
         auto new_blocks = fs().allocate_blocks(fs().group_index_from_inode(index()), blocks_needed_after - blocks_needed_before);