[freenos] [freenos commit] r179 - Corrected the offset calculation of Ext2Groups.

  • From: codesite-noreply@xxxxxxxxxx
  • To: freenos@xxxxxxxxxxxxx
  • Date: Thu, 02 Jul 2009 19:33:26 +0000

Author: nieklinnenbank
Date: Thu Jul  2 11:46:33 2009
New Revision: 179

Modified:
   trunk/srv/filesystem/ext2/Ext2FileSystem.cpp

Log:
Corrected the offset calculation of Ext2Groups.
This ensures filesystems which have superBlock.firstDataBlock <= 1
are mounted correctly.


Modified: trunk/srv/filesystem/ext2/Ext2FileSystem.cpp
==============================================================================
--- trunk/srv/filesystem/ext2/Ext2FileSystem.cpp        (original)
+++ trunk/srv/filesystem/ext2/Ext2FileSystem.cpp        Thu Jul  2 11:46:33 2009
@@ -73,8 +73,8 @@
     {
        /* Allocate buffer. */
        group   = new Ext2Group;
-       offset  = EXT2_SUPER_OFFSET;
-       offset += le32_to_cpu(superBlock.firstDataBlock) *
+       offset  = le32_to_cpu(superBlock.firstDataBlock ?
+                             superBlock.firstDataBlock + 1 : 1) *
                  EXT2_BLOCK_SIZE(&superBlock);
        offset += sizeof(Ext2Group) * i;


Other related posts:

  • » [freenos] [freenos commit] r179 - Corrected the offset calculation of Ext2Groups. - codesite-noreply