﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	field_blocks	field_dependson	field_seealso
168	Cannot write to file on FAT with certain root_ent_max / totsec	Jiri Svoboda		"For some combinations of root_ent_max (number of root entries) and totsec (total number of blocks in file system) the fat driver will mount successfully, but refuse to write data in a new file, returning ENOSPC.

This can be reproduced with HelenOS mkfat (on ia32):

{{{
$ dd if=/dev/zero of=img bs=512 count=180
$ qemu -m 32 -hda img -cdrom image.iso -boot d
# ata_bd
# mkfat bd/disk0
# mkdir /f
# mount fat /f bd/disk0
# mkfile --size 32 /f/test
}}}

or with dosfstools mkdosfs:

{{{
$ dd if=/dev/zero of=img bs=512 count=180
$ losetup /dev/loop0 img
$ mkdosfs -s 8 -r 128 -F 16 /dev/loop0
$ losetup -d /dev/loop0
$ qemu -m 32 -hda img -cdrom image.iso -boot d
# ata_bd
# mkdir /f
# mount fat /f bd/disk0
# mkfile --size 32 /f/test
}}}

My experiments indicate that (assuming root_ent_max is divisible by 16) if root_ent_max is >= 256, the problem is not reproduced for any block device size.

When root_ent_max is 192, the problem is reproduced iff totsec < 2046
When root_ent_max is 128, the problem is reproduced iff totsec < 6138
When root_ent_max is 64, the problem is reproduced iff totsec < 10230
"	defect	closed	major	0.4.2	helenos/fs/fat	mainline	fixed					
