Hi,
I've been working on the m68knommu port of the 2.6.23 kernel and
have found a problem that wasn't in the 2.6.22 release.
When I copy a 0 length file from a read-only filesystem I get the
following warning:
# cp exports /tmp
cp: Read error: Input/output error
This is really only a warning because the file is copied correctly.
Also, when I copy a file with data or copy a 0 length file within a
writable fs it passes.
I've traced the source of the error message to romfs_readpage() in
fs/romfs/inode.c. The "if (offset < i_size_read(inode))" check fails
and returns the "return -EIO" which causes the message above.
As far as I can tell the sequence seems to start falling off the tracks
in mm/filemap.c. The do_generic_mapping_read() routine has this test
that fails:
...
if (!PageUptodate(page))
goto page_not_up_to_date;
...
If I change the romfs_readpage() with the following patch it fixes
the problem, but this seems more like a "fixing the symptom" solution.
diff --git a/fs/romfs/inode.c b/fs/romfs/inode.c
index dae7945..ed04d73 100644
--- a/fs/romfs/inode.c
+++ b/fs/romfs/inode.c
@@ -430,7 +430,7 @@ romfs_readpage(struct file *file, struct page * page)
/* 32 bit warning -- but not for us :) */
offset = page_offset(page);
- if (offset < i_size_read(inode)) {
+ if (offset <= i_size_read(inode)) {
avail = inode->i_size-offset;
readlen = min_t(unsigned long, avail, PAGE_SIZE);
if (romfs_copyfrom(inode, buf, ROMFS_I(inode)->i_dataoffset+offs
et, readlen) == readlen) {
Any ideas on what's changed recently with romfs files? Any clues would be
appreciated.
Thanks,
Matt
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev