Opened 15 years ago
Closed 15 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: |
Description
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).
Note:
See TracTickets
for help on using tickets.
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.