[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: More JFFS problems...




alex@xxxxxxx.se said:
>  I've suspected problems like this since Sébastien managed to have his
> changes to mkfs.jffs work even though he didn't change the offset of
> the nodes... I think the handling of partial node rewriting isn't
> working.


Sure looks screwed to me. It'll quit as soon as it's filled the buffer, 
without even looking at later nodes in the log. It should examine _every_ 
node in order, copying data from each node whose range overlaps the range 
to be read. I'll have a go at that now.

(from jffs_read_data()):

	/* Fill the buffer.  */
	while (node && (read_data < size)) {
		int r;
		if (!node->fm) {
			/* This node does not refer to real data.  */
			r = jffs_min(size - read_data,
				     node->data_size - node_offset);
			memset(&buf[read_data], 0, r);
		}
		else if ((r = jffs_get_node_data(f, node, &buf[read_data],
						 node_offset,
						 size - read_data,
						 f->c->sb->s_dev)) < 0) {
			return r;
		}
		read_data += r;
		node_offset = 0;
		node = node->range_next;
	}

--
dwmw2