diff options
| author | Grzegorz Kostka <kostka.grzegorz@gmail.com> | 2018-09-26 22:35:36 +0200 |
|---|---|---|
| committer | Grzegorz Kostka <kostka.grzegorz@gmail.com> | 2018-09-26 22:35:36 +0200 |
| commit | c5f8d135cf3555404f1c4df5617f94f4fc2bac87 (patch) | |
| tree | d87da3e9c177bf0b621c0c52005dfe83a75b444a | |
| parent | 1aa974054274a4f59dfa59c88bb9a85461eca113 (diff) | |
ext4: fix ext4_fsymlink creation
Solve the problem with long symbolic links creation.
Thanks to: @cobenhan
| -rw-r--r-- | src/ext4.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -2474,15 +2474,16 @@ static int ext4_fsymlink_set(ext4_file *f, const void *buf, uint32_t size) memcpy(ref.inode->blocks, buf, size); ext4_inode_clear_flag(ref.inode, EXT4_INODE_FLAG_EXTENTS); } else { + uint64_t off; ext4_fs_inode_blocks_init(&f->mp->fs, &ref); r = ext4_fs_append_inode_dblk(&ref, &fblock, &sblock); if (r != EOK) goto Finish; - r = ext4_block_writebytes(f->mp->fs.bdev, 0, buf, size); + off = fblock * block_size; + r = ext4_block_writebytes(f->mp->fs.bdev, off, buf, size); if (r != EOK) goto Finish; - } /*Stop write back cache mode*/ |
