Ticket #5695: reiserfs-3.5-fix.patch

File reiserfs-3.5-fix.patch, 1.7 KB (added by wtachi, 14 years ago)
  • src/add-ons/kernel/file_systems/reiserfs/SuperBlock.cpp

     
    3232    \class DirEntry
    3333    \brief Represents the on-disk structure for super block of the FS.
    3434
    35     There exist two versions of the structure and this class can deal with
    36     both of them. The Init() methods tries to find and read the super block
    37     from disk.
     35    There exist two versions of the structure and this class can deal with both
     36    of them. This class can also handle a very old layout that puts the super
     37    block in a different location. The Init() methods tries to find and read
     38    the super block from disk.
    3839*/
    3940
    4041// read_super_block
     
    9596status_t
    9697SuperBlock::Init(int device, off_t offset)
    9798{
    98     // Not sure, if I understand the weird versioning.
    9999    status_t error = B_OK;
    100     // try old version
     100    // try old version and old layout
    101101    if (read_super_block(device, REISERFS_OLD_DISK_OFFSET_IN_BYTES + offset,
    102102                         REISERFS_SUPER_MAGIC_STRING, &fOldData) == B_OK) {
     103PRINT(("SuperBlock: ReiserFS 3.5 (old layout)\n"));
     104        fFormatVersion = REISERFS_3_5;
     105    // try old version and new layout
     106    } else if (read_super_block(device, REISERFS_DISK_OFFSET_IN_BYTES + offset,
     107            REISERFS_SUPER_MAGIC_STRING, &fOldData) == B_OK) {
    103108PRINT(("SuperBlock: ReiserFS 3.5\n"));
    104109        fFormatVersion = REISERFS_3_5;
    105     // try new version
     110    // try new version and new layout
    106111    } else if (read_super_block(device, REISERFS_DISK_OFFSET_IN_BYTES + offset,
    107112            REISER2FS_SUPER_MAGIC_STRING, &fOldData) == B_OK) {
    108113PRINT(("SuperBlock: ReiserFS 3.6\n"));