Opened 14 years ago

Closed 14 years ago

#255 closed defect (fixed)

Assertion failed (firstc >= FAT_CLST_FIRST && firstc < FAT_CLST_BAD) at 'fat_fat.c', line 515

Reported by: Štěpán Henek Owned by: Jakub Jermář
Priority: major Milestone: 0.4.3
Component: helenos/fs/fat Version: mainline
Keywords: Cc:
Blocker for: Depends on:
See also:

Description

By accident, I used write in an infinite loop, so it filled my small(16M) FAT partition (mounted to /data).
After killing the process using kcon, the root partition became unaccessible:
# cd /
Invalid directory '/' (No Such Entry)

and an assert appeared in the kernel console:
Assertion failed (firstc ≥ FAT_CLST_FIRST && firstc < FAT_CLST_BAD) at 'fat_fat.c', line 515

After a reboot the fat partition seemed to be destroyed.

Attachments (1)

Makefile.config (2.6 KB ) - added by Štěpán Henek 14 years ago.
My config file

Download all attachments as: .zip

Change History (7)

comment:1 by Jakub Jermář, 14 years ago

Component: uspace/libfsfs/fat
Milestone: 0.5.10.5.0
Owner: set to Jakub Jermář
Status: newaccepted

comment:2 by Jakub Jermář, 14 years ago

Hi Stepan,

what revision is this? I tried to reproduce your testcase, but in my case the write will start returning ENOSPACE after the file system is full and when I kill it, nothing special happens and I can run the test again. Also did you use HelenOS mkfat command to create the file system? Was the image created like: dd if=/dev/zero of=img bs=1024 count=16384?

Thanks,
Jakub

comment:3 by Jakub Jermář, 14 years ago

Summary: FAT full problemAssertion failed (firstc >= FAT_CLST_FIRST && firstc < FAT_CLST_BAD) at 'fat_fat.c', line 515

comment:4 by Štěpán Henek, 14 years ago

Hi Jakub,

it is revno: 631.
The easiest way to reproduce this situation is to use FAT as your RAM disk.
Then after boot, you can trigger it by editing a file using the edit command and saving and appending several times.

by Štěpán Henek, 14 years ago

Attachment: Makefile.config added

My config file

comment:5 by Jakub Jermář, 14 years ago

Priority: trivialmajor

Ok, I could reproduce it that way. The stack trace shows the following calling sequence:

fat_free_clusters()
fat_chop_clusters()
fat_truncate()

comment:6 by Jakub Jermář, 14 years ago

Resolution: fixed
Status: acceptedclosed

The recent sequential I/O improvements introduced a regression into fat_append_clusters() which in turn did not update nodep→firstc as necessary.

Fixed in changeset:mainline,632

Note: See TracTickets for help on using tickets.