Re: [Yaffs] Kernel panic in clear_inode when using yaffs as …

Top Page
Attachments:
Message as email
+ (text/plain)
+ yaffs_truncate_inode.patch (text/plain)
Delete this message
Reply to this message
Author: Andre Renaud
Date:  
To: Charles Manning
CC: manningc2, yaffs
Subject: Re: [Yaffs] Kernel panic in clear_inode when using yaffs as rootfs
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:                  Christchurch
Web:   http://www.bluewatersys.com              New Zealand

--- /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);
 }