[Yaffs] Kernel panic in clear_inode when using yaffs as rootfs

Andre Renaud andre at bluewatersys.com
Mon Nov 14 02:23:51 GMT 2005


Charles Manning wrote:
> Is this only with yaffs as root or will stress also break non-root?

I think I found it, according to fs/inode.c:1039
        if (op->delete_inode) {
                void (*delete)(struct inode *) = op->delete_inode;
                if (!is_bad_inode(inode))
                        DQUOT_INIT(inode);
                /* Filesystems implementing their own
                 * s_op->delete_inode are required to call
                 * truncate_inode_pages and clear_inode()
                 * internally */
                delete(inode);
        } else {
                truncate_inode_pages(&inode->i_data, 0);
                clear_inode(inode);
        }

However, yaffs_delete_inode does not call truncate_inode_pages.

The attached patch seems to resolve it.

Thanks,
Andre

-- 
Bluewater Systems Ltd - ARM Technology Solutions Centre

       Andre Renaud                             Bluewater Systems Ltd
Phone: +64 3 3779127 (Aus 1 800 148 751)        Level 17, 119 Armagh St
Fax:   +64 3 3779135                            PO Box 13889
Email: arenaud at bluewatersys.com                 Christchurch
Web:   http://www.bluewatersys.com              New Zealand
-------------- next part --------------
--- /home/andre/snapper//yaffs2/yaffs_fs.c	2005-10-28 11:24:04.000000000 +1300
+++ fs/yaffs2/yaffs_fs.c	2005-11-14 15:20:54.000000000 +1300
@@ -398,6 +414,9 @@
 		yaffs_DeleteFile(obj);
 		yaffs_GrossUnlock(dev);
 	}
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13))
+        truncate_inode_pages (&inode->i_data, 0);
+#endif
 	clear_inode(inode);
 }
 


More information about the yaffs mailing list