Opened 4 days ago
Last modified 4 days ago
#897 new defect
Deleting directory tree fails on tmpfs
| Reported by: | Jiri Svoboda | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | helenos/unspecified | Version: | mainline |
| Keywords: | Cc: | ||
| Blocker for: | Depends on: | ||
| See also: |
Description
Deleting a directory tree works with an Ext4 volume:
/ # cp -r /include /vol/test / # rm -rf /vol/test/include / #
but fails with tmpfs:
/ # cp -r /include /tmp / # rm -rf /tmp/include Can not remove /tmp/include/libc/elf (Method Not Supported) Can not remove /tmp/include/libc/io (Method Not Supported) Can not remove /tmp/include/libc/ipc (Method Not Supported) Can not remove /tmp/include/libc/loader (Method Not Supported) Can not remove /tmp/include/libc/rtld (Method Not Supported) Can not remove /tmp/include/libc/types (Method Not Supported) Can not remove /tmp/include/libc/vfs (Method Not Supported) Can not remove /tmp/include/libc/device (Method Not Supported) Can not remove /tmp/include/libc/adt (Method Not Supported) Can not remove /tmp/include/libc/libarch (Method Not Supported) Can not remove /tmp/include/libc/abi/ddi (Method Not Supported) Can not remove /tmp/include/libc/abi/proc (Method Not Supported) Can not remove /tmp/include/libc/abi (Method Not Supported) Can not remove /tmp/include/libc/_bits (Method Not Supported) Can not remove /tmp/include/libc (Method Not Supported) Can not remove /tmp/include/libinput/io (Method Not Supported) Can not remove /tmp/include/libinput (Method Not Supported) Can not remove /tmp/include/liboutput/io (Method Not Supported) Can not remove /tmp/include/liboutput (Method Not Supported) Can not remove /tmp/include/libconsole (Method Not Supported) Can not remove /tmp/include/libpcm/pcm (Method Not Supported) Can not remove /tmp/include/libpcm (Method Not Supported) Can not remove /tmp/include/libposix/sys (Method Not Supported) Can not remove /tmp/include/libposix (Method Not Supported) Can not remove /tmp/include/common/elf (Method Not Supported) Can not remove /tmp/include/common/io (Method Not Supported) Can not remove /tmp/include/common/ipc (Method Not Supported) Can not remove /tmp/include/common/loader (Method Not Supported) Can not remove /tmp/include/common/rtld (Method Not Supported) Can not remove /tmp/include/common/types (Method Not Supported) Can not remove /tmp/include/common/vfs (Method Not Supported) Can not remove /tmp/include/common/device (Method Not Supported) Can not remove /tmp/include/common/adt (Method Not Supported) Can not remove /tmp/include/common/libarch (Method Not Supported) Can not remove /tmp/include/common/abi/ddi (Method Not Supported) Can not remove /tmp/include/common/abi/proc (Method Not Supported) Can not remove /tmp/include/common/abi (Method Not Supported) Can not remove /tmp/include/common/_bits (Method Not Supported) Can not remove /tmp/include/common (Method Not Supported) Can not remove /tmp/include/libdisplay/display (Method Not Supported) Can not remove /tmp/include/libdisplay/types/display (Method Not Supported) Can not remove /tmp/include/libdisplay/types (Method Not Supported) Can not remove /tmp/include/libdisplay (Method Not Supported) Can not remove /tmp/include/libui/types/ui (Method Not Supported) Can not remove /tmp/include/libui/types (Method Not Supported) Can not remove /tmp/include/libui/ui (Method Not Supported) Can not remove /tmp/include/libui (Method Not Supported) Can not remove /tmp/include (Method Not Supported) / #
With Navigator or delete we also fail.
Deleting an individual file or empty directory on tmpfs succeeds.
Change History (3)
comment:1 by , 4 days ago
comment:2 by , 4 days ago
My intuition is that active opendir() should not "block" the directory for modification. Just as opening a file for reading does not block writes to that same file. Ideally, the filesystem would cache an atomic snapshot of the directory state at the time of opendir() and then list that snapshot regardless of what other changes to the filesystem are co-occuring.
comment:3 by , 4 days ago
That said, I think there also should be a "remove directory" macro method on the filesystem end. All that IPC back and forth when the only goal is to delete everything sounds like a performance nightmare.

I think this might be because we have a directory open, read one entry after another and delete them. In other words, the directory is being modified while we read it and it seems this does not go well with tmpfs. If so, is it a bug/design issue in tmpfs, VFS or the file system utilities?