Ext2 filesystem driver doesn't delete directory entries on disc

Project:JNode FS
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

While working on a testcase for another issue, I found that the Ext2 driver does not delete the disc entry in the implementation of FSDirectory.remove().

The bug is that AbstractFSDirectory is expecting Ext2Directory.writeEntries() to flush the changes in its in-memory entries cache for the directory to disc, but the method is a no-op. The net result is that the entry is removed from the in-memory cache but not from the directory on disc.

I don't have an explicit test case, but this is causing the following failure in FSTestSuite ... after you apply the patch in issue #2626.

4) BasicFSTest.testDirectoryDeletable(OtherOS,ext2 rwnot formatted
File[diskimg.WRK 1M]) 
org.jnode.fs.NonemptyDirectoryException: cannot delete non-empty directory
	at org.jnode.fs.ext2.Ext2Directory.checkDeletable(Ext2Directory.java:185)
	at org.jnode.test.fs.filesystem.tests.BasicFSTest.testDirectoryDeletable(BasicFSTest.java:206)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at org.jnode.test.fs.filesystem.FSTestSuite.main(FSTestSuite.java:71)