因為之前都使用NOR Flash作資料儲存,一直未碰到問題。
但這次需要同時支援兩種Flash,將兩種支援設定均開啟後,在存取NOR Flash時總是發生Crash。
找了好久才找到原因所在--未檢查Buffer是否存在。
套上下面的更新便解決啦!


Index: linux/fs/jffs2/wbuf.c
============================================================
--- linux.orig/fs/jffs2/wbuf.c
+++ linux/fs/jffs2/wbuf.c
@@ -532,6 +532,9 @@

    D1(printk(KERN_DEBUG "jffs2_flush_wbuf_gc() called for ino #%u...\n", ino));

+    if (!c->wbuf)
+        return 0;
+
    down(&c->alloc_sem);
    if (!jffs2_wbuf_pending_for_ino(c, ino)) {
        D1(printk(KERN_DEBUG "Ino #%d not pending in wbuf. Returning\n", ino));
@@ -578,6 +581,9 @@
{
    int ret;

+    if (!c->wbuf)
+        return 0;
+
    down_write(&c->wbuf_sem);
    ret = __jffs2_flush_wbuf(c, PAD_NOACCOUNT);
    up_write(&c->wbuf_sem);

Posted by clplayer at 痞客邦 PIXNET Comments(0) Trackback(0) Hits(236)