summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Kostka <kostka.grzegorz@gmail.com>2018-09-26 22:35:36 +0200
committerGrzegorz Kostka <kostka.grzegorz@gmail.com>2018-09-26 22:35:36 +0200
commitc5f8d135cf3555404f1c4df5617f94f4fc2bac87 (patch)
treed87da3e9c177bf0b621c0c52005dfe83a75b444a
parent1aa974054274a4f59dfa59c88bb9a85461eca113 (diff)
ext4: fix ext4_fsymlink creation
Solve the problem with long symbolic links creation. Thanks to: @cobenhan
-rw-r--r--src/ext4.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ext4.c b/src/ext4.c
index ab7b61f..b270361 100644
--- a/src/ext4.c
+++ b/src/ext4.c
@@ -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*/