diff -uNr u-boot-1.1.6/fs/jffs2/jffs2_1pass.c u-boot-1.1.6-jffs2fix/fs/jffs2/jffs2_1pass.c
--- u-boot-1.1.6/fs/jffs2/jffs2_1pass.c	2006-11-02 09:15:01.000000000 -0500
+++ u-boot-1.1.6-jffs2fix/fs/jffs2/jffs2_1pass.c	2007-01-11 21:03:31.000000000 -0500
@@ -442,7 +442,7 @@
 	}
 	new->offset = offset;
 
-#ifdef CFG_JFFS2_SORT_FRAGMENTS
+#if defined(CFG_JFFS2_SORT_FRAGMENTS) && defined(CFG_JFFS2_SORT_FRAGMENTS_OLD)
 	if (list->listTail != NULL && list->listCompare(new, list->listTail))
 		prev = list->listTail;
 	else if (list->listLast != NULL && list->listCompare(new, list->listLast))
@@ -1165,9 +1165,9 @@
 	struct b_lists *pL;
 	struct jffs2_unknown_node *node;
 	u32 offset, oldoffset = 0;
+	u32 partoffset;
 	u32 max = part->size - sizeof(struct jffs2_raw_inode);
 	u32 counter = 0;
-	u32 counter4 = 0;
 	u32 counterF = 0;
 	u32 counterN = 0;
 
@@ -1179,24 +1179,27 @@
 	/* if we are building a list we need to refresh the cache. */
 	jffs_init_1pass_list(part);
 	pL = (struct b_lists *)part->jffs2_priv;
-	offset = 0;
+
+	partoffset=get_node_mem(part->offset);
+	max+=partoffset;
+	offset=partoffset;
+
 	puts ("Scanning JFFS2 FS:   ");
 
 	/* start at the beginning of the partition */
 	while (offset < max) {
-	    	if ((oldoffset >> SPIN_BLKSIZE) != (offset >> SPIN_BLKSIZE)) {
-			printf("\b\b%c ", spinner[counter++ % sizeof(spinner)]);
-			oldoffset = offset;
-		}
+//	   	if ((oldoffset >> SPIN_BLKSIZE) != (offset >> SPIN_BLKSIZE)) {
+//			printf("\b\b%c ", spinner[counter++ % sizeof(spinner)]);
+//			oldoffset = offset;
+//		}
 
-		node = (struct jffs2_unknown_node *) get_node_mem((u32)part->offset + offset);
+		node = (struct jffs2_unknown_node *) (offset);
 		if (node->magic == JFFS2_MAGIC_BITMASK && hdr_crc(node)) {
 			/* if its a fragment add it */
 			if (node->nodetype == JFFS2_NODETYPE_INODE &&
 				    inode_crc((struct jffs2_raw_inode *) node) &&
 				    data_crc((struct jffs2_raw_inode *) node)) {
-				if (insert_node(&pL->frag, (u32) part->offset +
-						offset) == NULL) {
+				if (insert_node(&pL->frag, offset) == NULL) {
 					put_fl_mem(node);
 					return 0;
 				}
@@ -1205,8 +1208,7 @@
 				   dirent_name_crc((struct jffs2_raw_dirent *) node)) {
 				if (! (counterN%100))
 					puts ("\b\b.  ");
-				if (insert_node(&pL->dir, (u32) part->offset +
-						offset) == NULL) {
+				if (insert_node(&pL->dir, offset) == NULL) {
 					put_fl_mem(node);
 					return 0;
 				}
@@ -1221,6 +1223,10 @@
 					printf("OOPS Padding has bad size "
 						"%d < %d\n", node->totlen,
 						sizeof(struct jffs2_unknown_node));
+			} else if (node->nodetype == JFFS2_NODETYPE_ERASEBLOCK_HEADER) {
+				// Could check offset here to ensure we're at start of erase block
+			} else if (node->nodetype == JFFS2_NODETYPE_SUMMARY) {
+				// Ignore summary blocks for now
 			} else {
 				printf("Unknown node type: %x len %d "
 					"offset 0x%x\n", node->nodetype,
@@ -1228,17 +1234,21 @@
 			}
 			offset += ((node->totlen + 3) & ~3);
 			counterF++;
-		} else if (node->magic == JFFS2_EMPTY_BITMASK &&
-			   node->nodetype == JFFS2_EMPTY_BITMASK) {
-			offset = jffs2_scan_empty(offset, part);
+//		} else if (node->magic == JFFS2_EMPTY_BITMASK &&
+//			   node->nodetype == JFFS2_EMPTY_BITMASK) {
+//			offset = jffs2_scan_empty(offset, part);
 		} else {	/* if we know nothing, we just step and look. */
 			offset += 4;
-			counter4++;
 		}
 /*             printf("unknown node magic %4.4x %4.4x @ %lx\n", node->magic, node->nodetype, (unsigned long)node); */
 		put_fl_mem(node);
 	}
 
+#if defined(CFG_JFFS2_SORT_FRAGMENTS) && !defined(CFG_JFFS2_SORT_FRAGMENTS_OLD)
+	sort_list(&pL->dir);
+	sort_list(&pL->frag);
+#endif
+
 	putstr("\b\b done.\r\n");		/* close off the dots */
 	/* turn the lcd back on. */
 	/* splash(); */
diff -uNr u-boot-1.1.6/fs/jffs2/Makefile u-boot-1.1.6-jffs2fix/fs/jffs2/Makefile
--- u-boot-1.1.6/fs/jffs2/Makefile	2006-11-02 09:15:01.000000000 -0500
+++ u-boot-1.1.6-jffs2fix/fs/jffs2/Makefile	2007-01-11 17:13:02.000000000 -0500
@@ -28,6 +28,7 @@
 AOBJS	=
 COBJS	= jffs2_1pass.o compr_rtime.o compr_rubin.o compr_zlib.o mini_inflate.o
 COBJS	+= compr_lzo.o compr_lzari.o
+COBJS   += mergesort.o
 
 SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
diff -uNr u-boot-1.1.6/fs/jffs2/mergesort.c u-boot-1.1.6-jffs2fix/fs/jffs2/mergesort.c
--- u-boot-1.1.6/fs/jffs2/mergesort.c	1969-12-31 19:00:00.000000000 -0500
+++ u-boot-1.1.6-jffs2fix/fs/jffs2/mergesort.c	2007-01-11 17:12:31.000000000 -0500
@@ -0,0 +1,93 @@
+/*
+ * This file is copyright 2001 Simon Tatham.
+ * Rewritten from original source 2006 by Dan Merillat for use in u-boot.
+ * 
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use,
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ * 
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT.  IN NO EVENT SHALL SIMON TATHAM BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <common.h>
+#include "jffs2_private.h"
+
+int sort_list(struct b_list * list) {
+	struct b_node *p, *q, *e, *tail, *head;
+	int k, nmerges, psize, qsize, i;
+
+	if (!list->listHead)
+		return 0;
+
+	k=1;
+
+	while(1) {
+		p = list->listHead;
+		list->listHead=NULL;
+		tail = NULL;
+		nmerges=0;
+		while(p) {
+			nmerges++;
+			/* step 'k' places from p; */
+			q = p;
+			psize=0;
+			for(i=0;i<k;i++) {
+				psize++;
+				q=q->next;
+				if (!q)
+					break;
+			}
+			qsize = k;
+
+			/* two lists, merge them. */
+			while(psize || (qsize && q)) {
+				/* merge the next element */
+				if (psize == 0) {
+					/* p is empty, from q */
+					e = q; 
+					q = q->next; qsize--;
+				} else if (qsize == 0 || !q) {
+					e = p;
+					p = p->next; psize--;
+				} else if (list->listCompare(p, q)) {
+					/* p>q, so q next */
+					e = q;
+					q = q->next; qsize--;
+				} else {
+					e = p;
+					p = p->next; psize--;
+				}
+				if (tail)
+					tail->next=e;
+				else
+					list->listHead = e;
+				tail = e;
+				tail->next=0; // break any accidental circular loops.
+			}
+
+			/* mergesort the next segment */
+			p = q;
+		}
+		if (nmerges <= 1)
+			return 0;
+
+		if (k>list->listCount)
+			return 0;
+		k *= 2;
+	}
+}
