Opened 16 years ago
Closed 16 years ago
#3476 closed bug (fixed)
BFS directory corruption when directory removes itself
Reported by: | mmlr | Owned by: | axeld |
---|---|---|---|
Priority: | high | Milestone: | R1/alpha1 |
Component: | File Systems/BFS | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
When doing a "rmdir ." from an empty directory, BFS will use the directory inode "." to remove the entry ".". This will set the node to deleted, but it doesn't remove the node from the parent directory. Opening the parent directory will then fail with "inode already deleted".
Steps to reproduce:
mkdir -p test1/test2 cd test1/test2 rmdir . cd .. ls
The ls will fail, corresponding messages are printed to the syslog. Such a directory cannot be deleted anymore.
I think in case someone tries to remove "." this has to be resolved to the entry in the parent directory instead and the parent directory has to do the removal.
Note:
See TracTickets
for help on using tickets.
Fixed in hrev29296 by disallowing removing "." in the VFS already. It's done the same way in other operating systems and it seems that other file systems could easily be affected by this corner case as well so it seems more appropriate to handle it in the VFS.