mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 01:12:44 +00:00 
			
		
		
		
	Ext2FS: Fix block allocation ignoring the very last block group
The block group indices are 1-based for some reason. Because of that, we were forgetting to check in the very last block group when doing block allocation. This caused block allocation to fail even when the superblock indicated that we had free blocks. Fixes #3674.
This commit is contained in:
		
							parent
							
								
									d1592643a6
								
							
						
					
					
						commit
						eeffd5be07
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -1135,7 +1135,7 @@ Vector<Ext2FS::BlockIndex> Ext2FS::allocate_blocks(GroupIndex preferred_group_in | |||
|         } else { | ||||
|             if (group_index == preferred_group_index) | ||||
|                 group_index = 1; | ||||
|             for (; group_index < m_block_group_count; ++group_index) { | ||||
|             for (; group_index <= m_block_group_count; ++group_index) { | ||||
|                 if (group_descriptor(group_index).bg_free_blocks_count) { | ||||
|                     found_a_group = true; | ||||
|                     break; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling