Can not say why, but attached code will change FS in the way, that e2fsck found errors, eliminate them, but after that, kernel can not stat file created by my program.
The kernel say:
EXT4-fs error (device loop0): ext4_ext_check_inode: inode #909: (comm gvfs-gdu-volume) bad header/extent: invalid magic - magic 0, entries 0, max 0(0), depth 0(0)
To acheive effect, find #ifdef 0 and replace it with #ifdef 1
Do not say me why ext2fs_write_inode() does not suitable in that place for setting file size. I already understand.