alperakcan / fuse-ext2

Fuse-ext2 is a multi OS FUSE module to mount ext2, ext3 and ext4 file system devices and/or images with read write support.
GNU General Public License v2.0
806 stars 130 forks source link

information of deleted files shows when mouting ext4 with fuse-ext2 #48

Closed swinds24 closed 7 years ago

swinds24 commented 7 years ago

Hi,

I found a strange behavior that some information of the previously deleted files will be shown via ls:

version

root@jerry-QV96:~# fuse-ext2 30G /mnt/test/ -o ro,debug FUSE library version: 2.9.4 nullpath_ok: 0 nopath: 0 utime_omit_ok: 0 unique: 1, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0 INIT: 7.25 flags=0x0007fffb max_readahead=0x00020000 INIT: 7.19 flags=0x00000011 max_readahead=0x00020000 max_write=0x00020000 max_background=0 congestion_threshold=0 unique: 1, success, outsize: 40

reproduce steps

  1. dd if=/dev/zero of=30G bs=1M count=30k
  2. mke2fs -t ext4 -E lazy_itable_init=0,lazy_journal_init=0 30G
  3. mount -t ext4 30G /mnt/test/
  4. cd /mnt/test; for i in {1..100000}; do dd if=/dev/zero of=file_${i} bs=32k count=1 1>/dev/null 2>/dev/null; done
  5. rm file_*
  6. umount /mnt/test
  7. fuse-ext2 30G /mnt/test/ -o ro

partial strange output

ls: cannot access '/mnt/test/file_15218': No such file or directory ls: cannot access '/mnt/test/file_1976': No such file or directory ls: cannot access '/mnt/test/file_79166': No such file or directory ls: cannot access '/mnt/test/file_92316': No such file or directory ls: cannot access '/mnt/test/file_55271': No such file or directory ls: cannot access '/mnt/test/file_75956': No such file or directory

(some output is omitted...)

-????????? ? ? ? ? ? file_9675 -????????? ? ? ? ? ? file_9688 -????????? ? ? ? ? ? file_9765 -????????? ? ? ? ? ? file_98 -????????? ? ? ? ? ? file_9831 -????????? ? ? ? ? ? file_9931 -????????? ? ? ? ? ? file_9979 drwx------ 2 root root 16384 Nov 30 17:36 lost+found

However, if I mount the 30G image with "mount -t ext4 30G /mnt/test", everything works well as my expect. BTW, instead of creating 100k files and deleting them as above steps, I've tried only few files (about 100 files) and nothing strange happens.

Is there anything I could try to avoid the issue? Any idea will be appreciated, thanks!

alperakcan commented 7 years ago

thank your for clear instructions. I was able to reproduce easily. Can you please check and verify with latest commit.

swinds24 commented 7 years ago

Hi, The issue is fixed with the latest commit! Thanks for your help. :)