[PATCH] [JFFS2] Fix getdents problem on large directories.

Joakim Tjernlund Joakim.Tjernlund at transmode.se
Sun Oct 28 08:34:38 EDT 2007


Another fallout from commit a491486a2087ac3dfc00efb4f838c8d684afaf54
rm -rf on a large directory needs to call getdents several times.
The second call would usally return empty, telling the user that
there are no more files to unlink, rmdir then fails since the
directory isn't empty.
---
 fs/jffs2/write.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/fs/jffs2/write.c b/fs/jffs2/write.c
index 2f56954..358f197 100644
--- a/fs/jffs2/write.c
+++ b/fs/jffs2/write.c
@@ -591,9 +591,7 @@ int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f,
 				D1(printk(KERN_DEBUG "Marking old dirent node (ino #%u) @%08x obsolete\n",
 					  this->ino, ref_offset(this->raw)));
 
-				*prev = this->next;
-				jffs2_mark_node_obsolete(c, (this->raw));
-				jffs2_free_full_dirent(this);
+				this->ino = 0;
 				break;
 			}
 			prev = &((*prev)->next);
-- 
1.5.3.4




More information about the linux-mtd mailing list