Fork us on GitHub Follow us on Facebook Follow us on Twitter

Opened 9 years ago

Closed 9 years ago

#168 closed defect (fixed)

Cannot write to file on FAT with certain root_ent_max / totsec

Reported by: Jiri Svoboda Owned by:
Priority: major Milestone: 0.4.2
Component: helenos/fs/fat Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description

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

Change History (1)

comment:1 Changed 9 years ago by Jakub Jermář

Resolution: fixed
Status: newclosed

Fixed in changeset:head,214.

Note: See TracTickets for help on using tickets.