* jffs_file_write and DOC
@ 2000-07-19 1:25 Rogelio M. Serrano Jr.
2000-07-19 14:03 ` Finn Hakansson
2000-07-19 19:13 ` David Woodhouse
0 siblings, 2 replies; 3+ messages in thread
From: Rogelio M. Serrano Jr. @ 2000-07-19 1:25 UTC (permalink / raw)
To: mtd
I observed that the jffs_file_write function misbehaves when given a
chunk bigger than MAX_CHUNK_SIZE. It is passed a chunk exactly equal to
MAX_CHUNK_SIZE so when it adds the inode and the name the resulting
chunk in is more or less 60 bytes bigger than MAX_CHUNK_SIZE which is
4096 bytes in my case with the DOC2000.
Cat just writes a file shorter than it should be on flash. I used a
modified DOC_loadbios utility to download my JFFS images to the DOC. If
I dont write anything to it I could mount and unmount cleanly. But when
I write to it, I get bad checksums on the next mount and totoal mount
failure after couple more mounts.
How is jffs_write_file called when we write a large file to flash? I
dont see any loops in jffs_file_write. Does the VFS layer handle the
subdivisions and calls jffs_file_write with chunks equal to max chunk
size? How do we handle this ?
To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: jffs_file_write and DOC
2000-07-19 1:25 jffs_file_write and DOC Rogelio M. Serrano Jr.
@ 2000-07-19 14:03 ` Finn Hakansson
2000-07-19 19:13 ` David Woodhouse
1 sibling, 0 replies; 3+ messages in thread
From: Finn Hakansson @ 2000-07-19 14:03 UTC (permalink / raw)
To: Rogelio M. Serrano Jr.; +Cc: mtd, jffs-dev, Per Knudsen
On Wed, 19 Jul 2000, Rogelio M. Serrano Jr. wrote:
> I observed that the jffs_file_write function misbehaves when given a
> chunk bigger than MAX_CHUNK_SIZE. It is passed a chunk exactly equal to
> MAX_CHUNK_SIZE so when it adds the inode and the name the resulting
> chunk in is more or less 60 bytes bigger than MAX_CHUNK_SIZE which is
> 4096 bytes in my case with the DOC2000.
This is a problem that I gave some thought yesterday.
Yes, I guess you're right. The total size of a chunk of data on the
flash should be 32768 bytes (2^15 bytes). In a data chunk we always
have a raw inode, possibly a name and possibly some data. The size of
the raw inode is always 60 bytes. The maximum size of a name field is
256 bytes. This gives us a total size of between (32768 - 60 - 256)
and (32768 - 60) bytes of data possible to add in each data chunk.
> Cat just writes a file shorter than it should be on flash. I used a
> modified DOC_loadbios utility to download my JFFS images to the DOC. If
> I dont write anything to it I could mount and unmount cleanly. But when
> I write to it, I get bad checksums on the next mount and totoal mount
> failure after couple more mounts.
Could you explain this in more detail, please?
> How is jffs_write_file called when we write a large file to flash? I
> dont see any loops in jffs_file_write. Does the VFS layer handle the
> subdivisions and calls jffs_file_write with chunks equal to max chunk
> size? How do we handle this ?
Right now the jffs_file_write function does not loop as it should if
it is writing something larger than MAX_CHUNK_SIZE. This should be
fixed soon I hope. It is not a difficult thing to fix I guess.
Thanks!
/Finn
To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: jffs_file_write and DOC
2000-07-19 1:25 jffs_file_write and DOC Rogelio M. Serrano Jr.
2000-07-19 14:03 ` Finn Hakansson
@ 2000-07-19 19:13 ` David Woodhouse
1 sibling, 0 replies; 3+ messages in thread
From: David Woodhouse @ 2000-07-19 19:13 UTC (permalink / raw)
To: Rogelio M. Serrano Jr.; +Cc: mtd
On Wed, 19 Jul 2000, Rogelio M. Serrano Jr. wrote:
> I observed that the jffs_file_write function misbehaves when given a
> chunk bigger than MAX_CHUNK_SIZE. It is passed a chunk exactly equal to
> MAX_CHUNK_SIZE so when it adds the inode and the name the resulting
> chunk in is more or less 60 bytes bigger than MAX_CHUNK_SIZE which is
> 4096 bytes in my case with the DOC2000.
>
> Cat just writes a file shorter than it should be on flash. I used a
> modified DOC_loadbios utility to download my JFFS images to the DOC. If
> I dont write anything to it I could mount and unmount cleanly. But when
> I write to it, I get bad checksums on the next mount and totoal mount
> failure after couple more mounts.
There's a separate problem - the DiskOnChip MTD driver doesn't currently
handle writes which aren't 512 bytes long, if I recall correcty - because
I've not actually used it with anything but NFTL yet. It may not be
JFFS' fault.
--
dwmw2
To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2000-07-19 19:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-07-19 1:25 jffs_file_write and DOC Rogelio M. Serrano Jr.
2000-07-19 14:03 ` Finn Hakansson
2000-07-19 19:13 ` David Woodhouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox