Opened 14 years ago

Closed 14 years ago

#169 closed defect (fixed)

ls hangs in fat fs root directory if root_ent_max not divisible by 16

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


The fat file system driver does not handle the case when root_ent_max is not divisible by 16 (i.e. the root directory does not end on sector boundary).

Of course such setting is far from being standard / portable. The driver should either refuse to mount such file system, or handle the situation in some graceful, logical manner. (E.g. assuming space was reserved until the end of sector, but only using so many entries as was specified in the boot sector).

Change History (2)

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

I actually think that we should disallow root directories that are not aligned on block boundaries. Non-root directories are always aligned since the dentry size member is not defined for them so we always calculate the size by walking the FAT and counting clusters. Our code is written in such a way that it does not distinguish between root and non-root directory in many places, such as fat_read(). What happens is that fat_read() trips over an assert in fat_read() which detects that the directory size is not divisible by sector size and aborts the whole server. The system appears hung, because the root file system is dead.

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

Resolution: fixed
Status: newclosed

Fixed in changeset:head,216.

Note: See TracTickets for help on using tickets.