Mercurial > yaffs-ecoscentric-gpl
changeset 424:d21d6fd33e63
yaffs Fix incorrect handling of deletion flag
Move the reading of the deleted flag so that it picks up any changes.
Notw we need a value on the stack because the object might get
freed and we don't want to access a hanging pointer.
Signed-off-by: Charles Manning <cdhmanning@gmail.com>
| author | Charles Manning <cdhmanning@gmail.com> |
|---|---|
| date | Thu, 13 May 2010 14:29:16 +1200 |
| parents | 29b309f8db6a |
| children | dea4d7d250ad 27f99d87a73d 5a26e5bec29d |
| files | yaffs_guts.c |
| diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/yaffs_guts.c +++ b/yaffs_guts.c @@ -5624,7 +5624,7 @@ static int yaffs_UnlinkFileIfNeeded(yaff int yaffs_DeleteFile(yaffs_Object *in) { int retVal = YAFFS_OK; - int deleted = in->deleted; + int deleted; /* Need to cache value on stack if in is freed */ yaffs_Device *dev = in->myDev; if (dev->param.disableSoftDelete || dev->param.isYaffs2) @@ -5637,6 +5637,8 @@ int yaffs_DeleteFile(yaffs_Object *in) if (!in->unlinked) retVal = yaffs_UnlinkFileIfNeeded(in); + deleted = in->deleted; + if (retVal == YAFFS_OK && in->unlinked && !in->deleted) { in->deleted = 1; deleted = 1;
