I've removed my modifications and applied your patch.
Now it works OK if I create a folder and immediately delete it.
But on some other folders (with files and subfolder) it fails (same
message: directory not empty), after a reboot I manage to delete the
directories.
I've tried to reproduce that with my "patch" and it works ok on the same
situation.
------------------------------------------------------------
I was able to reproduce this using yaffs1 mode on a Ubuntu host running
nandsim, but the problem was intermittent.
I think there could be an issue related to soft deletion and how it
interacts with renaming etc.
Please try disabling soft deletion and seeing if that makes the problem go
away.
--- a/yaffs_vfs_multi.c
+++ b/yaffs_vfs_multi.c
@@ -2909,6 +2909,7 @@ static struct super_block
*yaffs_internal_read_super(int yaffs_version,
param->read_chunk_fn = nandmtd_read_chunk; #endif
param->is_yaffs2 = 0;
+ param->disable_soft_del = 1;
}
/* ... and common functions */
param->erase_fn = nandmtd_erase_block;
Please report back.
Thanks
Charles
On Monday 31 January 2011 21:58:59 Baptiste Vial wrote:
> Thanks a lot for your answer.
>
> Here are some complements:
> The directory isn't deleted after un umount/mount or reboot, still
> undeletable.
> I've tried the "echo 3 > /proc/sys/vm/drop_caches" but I still get the
> "Directory not empty" message without being able to delete the folder.
>
> I've tried a modification on "yaffs_guts.c" which solves the problem
> but I'm not sure if it is safe.
> The modification is on "yaffs_change_obj_name()", my partition is not
> detected as yaffs2 since it is small (56Mo) and in "auto" mode.
>
> Before:
>
>-----------------------------------------------------------------------
>----
>--------------------- unlink_op = (new_dir == obj->my_dev->unlinked_dir
> && obj->variant_type ==
YAFFS_OBJECT_TYPE_FILE);
>
>-----------------------------------------------------------------------
>----
>---------------------
>
> After:
>
>-----------------------------------------------------------------------
>----
>--------------------- unlink_op = (new_dir == obj->my_dev->unlinked_dir
> && (obj->variant_type ==
YAFFS_OBJECT_TYPE_FILE
>
> || new_dir->variant_type ==
YAFFS_OBJECT_TYPE_DIRECTORY));
>
>
>-----------------------------------------------------------------------
>----
>---------------------
>
> Best regards and thanks for the great job Baptiste VIAL
>
> -----Message d'origine-----
> De : Charles Manning [mailto:manningc2@actrix.gen.nz] Envoy? : lundi
> 31 janvier 2011 03:56 ? : yaffs@lists.aleph1.co.uk Cc : Baptiste Vial
> Objet : Re: [Yaffs] Unable to remove a directory which has juste been
> created
>
> On Saturday 29 January 2011 01:06:34 Baptiste Vial wrote:
> > Hi everyone,
> >
> >
> >
> > I?m using the last version of yaffs2
> > (2c8eb2bdc3e753893ecc0dd0cd9cba791d4e16db) with a 2.6.28 kernel on
> > my ARM board.
> >
> >
> >
> > If I try to create a directory and remove it, it always fail saying
> > the directory is not empty (but it is since I?ve not created any
> > files)
> >
> >
> >
> > Here what i see:
> >
> >
> >
> > *[/]# cd /home*
> >
> > *[/home]# mkdir test5*
> >
> > *[/home]# rm -Rf test5 *
> >
> > *rm: unable to remove `test5': Directory not empty*
>
> I just tried this on a 2.6.35 system with no errors though I was not
> using busybox.
>
> > if I do a ?echo +error+deletion+os-write > /proc/yaffs? here is what
> > I can
> > see:
> >
> >
> >
> > <7>yaffs: line 2549 delete of chunk 103438
> >
> > <7>yaffs: line 2549 delete of chunk 103439
> >
> > <7>yaffs: line 2549 delete of chunk 103440
> >
> > <7>yaffs: yaffs_touch_super() sb = c1f59c00
> >
> > <7>yaffs: line 2549 delete of chunk 103447
> >
> > <7>yaffs: line 2549 delete of chunk 103451
> >
> > <7>yaffs: yaffs_readdir: starting at 0
> >
> > <7>yaffs: yaffs_readdir: entry . ino 401
> >
> > <7>yaffs: yaffs_readdir: entry .. ino 259
> >
> > <7>yaffs: yaffs_readdir: starting at 2
> >
> > <7>yaffs: yaffs_unlink 259:test5
> >
> > <7>yaffs: yaffs_touch_super() sb = c1f59c00
> >
> > <7>yaffs: line 3419 delete of chunk 103656
> >
> > <7>yaffs: line 2549 delete of chunk 103452
> >
> > <7>yaffs: line 2549 delete of chunk 103453
> >
> > <7>yaffs: line 2549 delete of chunk 103454
> >
> > <7>yaffs: line 2549 delete of chunk 103455
> >
> > <7>yaffs: yaffs_touch_super() sb = c1f59c00
> >
> > <7>yaffs: line 1690 delete of chunk 103673
> >
> > <7>yaffs: FreeObject c0d8cf04 inode 00000000
> >
> >
> >
> > To perform the ?rm? I?m using BusyBox v1.18.1 Note that I don?t have
> > any problem unlinking files.
> >
> >
> >
> > What kind of test should I do to target more precisely the problem ?
>
> What is worth trying to figure out is if the problem is internal to
> yaffs or external to yaffs. One of the problems that confuses the
> picture is the kernel caching.
>
>
> There are a few things worth doing...
>
> 1) Was the directory actually deleted? If you umount and then mount is
> it still there?
>
> 2) The other thing to try is to drop the caches and see if that
> changes anything. This can be done by
>
> echo 3 > /proc/sys/vm/drop_caches
>
> -- Charles
>
> _______________________________________________
> yaffs mailing list
> yaffs@lists.aleph1.co.uk
> http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs
------------------------------
_______________________________________________
yaffs mailing list
yaffs@lists.aleph1.co.uk
http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs
End of yaffs Digest, Vol 69, Issue 1
************************************