Changeset f066a87 in mainline


Ignore:
Timestamp:
2017-05-09T18:55:11Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3345b86
Parents:
d2c8533
Message:

Ext4 should check for sanity before modifying the superblock.

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ext4/libext4_filesystem.c

    rd2c8533 rf066a87  
    105105                goto err_2;
    106106        }
     107       
     108        rc = ext4_superblock_check_sanity(fs->superblock);
     109        if (rc != EOK)
     110                goto err_2;
    107111
    108112        /* Mark system as mounted */
     
    148152       
    149153        return rc;
    150 }
    151 
    152 /** Check sanity of the filesystem.
    153  *
    154  * Main is the check of the superblock structure.
    155  *
    156  * @param fs Filesystem to be checked
    157  *
    158  * @return Error code
    159  *
    160  */
    161 int ext4_filesystem_check_sanity(ext4_filesystem_t *fs)
    162 {
    163         /* Check superblock */
    164         return ext4_superblock_check_sanity(fs->superblock);
    165154}
    166155
  • uspace/lib/ext4/libext4_filesystem.h

    rd2c8533 rf066a87  
    4141    enum cache_mode);
    4242extern int ext4_filesystem_fini(ext4_filesystem_t *);
    43 extern int ext4_filesystem_check_sanity(ext4_filesystem_t *);
    4443extern int ext4_filesystem_check_features(ext4_filesystem_t *, bool *);
    4544extern uint32_t ext4_filesystem_blockaddr2_index_in_group(ext4_superblock_t *,
  • uspace/srv/fs/ext4fs/ext4fs_ops.c

    rd2c8533 rf066a87  
    969969        int rc = ext4_filesystem_init(fs, service_id, cmode);
    970970        if (rc != EOK) {
    971                 free(fs);
    972                 free(inst);
    973                 return rc;
    974         }
    975        
    976         /* Do some sanity checking */
    977         rc = ext4_filesystem_check_sanity(fs);
    978         if (rc != EOK) {
    979                 ext4_filesystem_fini(fs);
    980971                free(fs);
    981972                free(inst);
Note: See TracChangeset for help on using the changeset viewer.