patch-2.4.19 linux-2.4.19/fs/jffs2/read.c

Next file: linux-2.4.19/fs/jffs2/readinode.c
Previous file: linux-2.4.19/fs/jffs2/nodemgmt.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.18/fs/jffs2/read.c linux-2.4.19/fs/jffs2/read.c
@@ -31,7 +31,7 @@
  * provisions above, a recipient may use your version of this file
  * under either the RHEPL or the GPL.
  *
- * $Id: read.c,v 1.13 2001/05/01 16:24:44 dwmw2 Exp $
+ * $Id: read.c,v 1.13.2.1 2002/02/01 23:32:33 dwmw2 Exp $
  *
  */
 
@@ -75,6 +75,12 @@
 		ret = -EIO;
 		goto out_ri;
 	}
+	/* There was a bug where we wrote hole nodes out with csize/dsize
+	   swapped. Deal with it */
+	if (ri->compr == JFFS2_COMPR_ZERO && !ri->dsize && ri->csize) {
+		ri->dsize = ri->csize;
+		ri->csize = 0;
+	}
 
 	D1(if(ofs + len > ri->dsize) {
 		printk(KERN_WARNING "jffs2_read_dnode() asked for %d bytes at %d from %d-byte node\n", len, ofs, ri->dsize);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)