projects
/
yaffs
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** empty log message ***
[yaffs/.git]
/
yaffs_fs.c
diff --git
a/yaffs_fs.c
b/yaffs_fs.c
index 099a1083122eb1ff1f1cccc3c9fea0a4c2e84260..00bb742cf4aff519208c626eab8a167cf458b33b 100644
(file)
--- a/
yaffs_fs.c
+++ b/
yaffs_fs.c
@@
-24,11
+24,12
@@
* * Nick Bane for numerous patches.
* * Nick Bane for 2.5/2.6 integration.
* * Andras Toth for mknod rdev issue.
* * Nick Bane for numerous patches.
* * Nick Bane for 2.5/2.6 integration.
* * Andras Toth for mknod rdev issue.
+ * * Michael Fischer for finding the problem with inode inconsistency.
* * Some code bodily lifted from JFFS2.
*/
* * Some code bodily lifted from JFFS2.
*/
-const char *yaffs_fs_c_version = "$Id: yaffs_fs.c,v 1.3
4 2004-09-20 22:00:20
charles Exp $";
+const char *yaffs_fs_c_version = "$Id: yaffs_fs.c,v 1.3
5 2004-10-20 20:12:43
charles Exp $";
extern const char *yaffs_guts_c_version;
extern const char *yaffs_guts_c_version;
@@
-364,15
+365,29
@@
static void yaffs_put_inode(struct inode *inode)
// clear is called to tell the fs to release any per-inode data it holds
static void yaffs_clear_inode(struct inode *inode)
{
// clear is called to tell the fs to release any per-inode data it holds
static void yaffs_clear_inode(struct inode *inode)
{
- yaffs_Object *obj = yaffs_InodeToObject(inode);
+ yaffs_Object *obj;
+ yaffs_Device *dev;
+
+ obj = yaffs_InodeToObject(inode);
T(YAFFS_TRACE_OS,("yaffs_clear_inode: ino %d, count %d %s\n",(int)inode->i_ino, atomic_read(&inode->i_count),
obj ? "object exists" : "null object"));
if(obj)
{
T(YAFFS_TRACE_OS,("yaffs_clear_inode: ino %d, count %d %s\n",(int)inode->i_ino, atomic_read(&inode->i_count),
obj ? "object exists" : "null object"));
if(obj)
{
+ dev = obj->myDev;
+ yaffs_GrossLock(dev);
+
+ // Clear the association between the inode ant the yaffs_Object.
obj->myInode = NULL;
obj->myInode = NULL;
- inode->u.generic_ip = NULL;
+ inode->u.generic_ip = NULL;
+
+ // If the object freeing was deferred, then the real free happens now.
+ // This should fix the inode inconsistency problem.
+
+ yaffs_HandleDeferedFree(obj);
+
+ yaffs_GrossUnlock(dev);
}
}