Changeset 4a3a5a0 in mainline for uspace/lib/ext4/src/superblock.c


Ignore:
Timestamp:
2025-01-29T14:02:50Z (3 weeks ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
f455de0
Parents:
ea50e671
Message:

One more tweak

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ext4/src/superblock.c

    rea50e671 r4a3a5a0  
    12311231        /* Preserve physical block data */
    12321232        rc = block_read_direct(service_id, first_block, 1, tmp_sb);
    1233         if (rc != EOK) {
    1234                 free(tmp_sb);
    1235                 return rc;
     1233        if (rc == EOK) {
     1234                /* Write the superblock */
     1235                void *sb_pos = tmp_sb + EXT4_SUPERBLOCK_OFFSET % phys_block_size;
     1236                memcpy(sb_pos, sb, EXT4_SUPERBLOCK_SIZE);
     1237
     1238                /* Write physical block to device */
     1239                rc = block_write_direct(service_id, first_block, 1, tmp_sb);
    12361240        }
    12371241
    1238         /* Write the superblock */
    1239         void *sb_pos = tmp_sb + EXT4_SUPERBLOCK_OFFSET % phys_block_size;
    1240         memcpy(sb_pos, sb, EXT4_SUPERBLOCK_SIZE);
    1241 
    1242         /* Write physical block to device */
    1243         rc = block_write_direct(service_id, first_block, 1, tmp_sb);
    12441242        free(tmp_sb);
    12451243        return rc;
Note: See TracChangeset for help on using the changeset viewer.