Skip to content

Commit

Permalink
ext4: fix ext4_fsymlink creation
Browse files Browse the repository at this point in the history
Solve the problem with long symbolic links creation.
Thanks to: @cobenhan
  • Loading branch information
gkostka committed Sep 26, 2018
1 parent 1aa9740 commit c5f8d13
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ext4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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*/
Expand Down

0 comments on commit c5f8d13

Please sign in to comment.