Changeset d510ac01 in mainline for uspace/srv/fs/ext4fs/ext4fs_ops.c


Ignore:
Timestamp:
2012-06-23T19:53:49Z (13 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
02020dc
Parents:
380553c
Message:

Fixed bug with different sizes in writing file on extents

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/ext4fs/ext4fs_ops.c

    r380553c rd510ac01  
    13441344                                (ext4_inode_has_flag(inode_ref->inode, EXT4_INODE_FLAG_EXTENTS))) {
    13451345
    1346                         uint32_t tmp_iblock = 0;
    1347                         do {
    1348                                 rc = ext4_filesystem_append_inode_block(inode_ref, &fblock, &tmp_iblock);
     1346                        uint32_t last_iblock = ext4_inode_get_size(fs->superblock, inode_ref->inode) / block_size;
     1347                        while (last_iblock < iblock) {
     1348                                rc = ext4_extent_append_block(inode_ref, &last_iblock, &fblock, true);
    13491349                                if (rc != EOK) {
    13501350                                        ext4fs_node_put(fn);
     
    13521352                                        return rc;
    13531353                                }
    1354                         } while (tmp_iblock < iblock);
     1354                        }
     1355
     1356                        rc = ext4_extent_append_block(inode_ref, &last_iblock, &fblock, false);
     1357                        if (rc != EOK) {
     1358                                ext4fs_node_put(fn);
     1359                                async_answer_0(callid, rc);
     1360                                return rc;
     1361                        }
    13551362
    13561363                } else {
Note: See TracChangeset for help on using the changeset viewer.