Opened 14 years ago
Closed 14 years ago
#288 closed defect (fixed)
fat crashes on assert(idxp->pfc) in fat_node_get_core()
Reported by: | Jakub Jermář | Owned by: | Jakub Jermář |
---|---|---|---|
Priority: | major | Milestone: | 0.4.3 |
Component: | helenos/fs/fat | Version: | |
Keywords: | Cc: | ||
Blocker for: | Depends on: | ||
See also: |
Description
In mainline,832, the following two commands:
# rm /log/klog # ls
will make FAT hit the following assertion in fat_node_get_core():
/* * We must instantiate the node from the file system. */ assert(idxp->pfc);
ls will report a problem after it printed two entries for srv and readme:
ls: skipping bogus node //drv
After switching to kconsole, we can see a message about the failed assertion and also a stack trace, from which we can see the calling sequence:
fat_node_get_core() fat_write()
I think the role of fat_write() can be substituted also by other callers of fat_node_get_core(), such as fat_sync().
Change History (4)
comment:1 by , 14 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:2 by , 14 years ago
Status: | assigned → accepted |
---|
comment:3 by , 14 years ago
comment:4 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
So the problem was that after unlinking the /log/klog node, its node structure was put on the node free list from where it might have been recycled for instantiating some other node. In that case, the node would be disassociated from its index structure and idx→pfc would be zeroed.
Fix merged in changeset:mainline,873.
I investigated the background of the:
message printed during ls. Note that the rc of -3 is ELIMIT returned by stat().
The reason for that is that stat() invokes a lookup operation, which fails at this place in _fat_block_get():
This is how we get to _fat_block_get():