Bug 64418 - load -m disk truncates files loaded
Summary: load -m disk truncates files loaded
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: eCos
Classification: Retired
Component: RedBoot
Version: CVS
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: eCos bugs internal list
QA Contact: eCos bugs internal list
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-05-04 02:07 UTC by Need Real Name
Modified: 2007-04-18 16:42 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2003-06-20 16:15:48 UTC
Embargoed:


Attachments (Terms of Use)

Description Need Real Name 2002-05-04 02:07:08 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)

Description of problem:
If the length of a file loaded from disk is not an integer multiple of 256 
bytes in length, the last (file_len modulo 256) bytes are not loaded

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.Configure RedBoot to support load from IDE disk
2. Attempt to load a file with a length that is not an even multiple of 256 
bytes
3. Note the output of the load command... the number of bytes loaded is rounded 
down to the nearest 256 byte boundary
	

Actual Results:  A file of length 514 bytes only loads the first 512 bytes.

Expected Results:  All 514 bytes should be loaded

Additional info:

In the file $ECOS_REPOSITORY/packages/redboot/current/src/fs/disk.c,
the function disk_stream_read() contains a line:

if ((nread = (file_part->funs->read)(fileptr, buf, size)) != size) {

which should be changed to:

if ((nread = (file_part->funs->read)(fileptr, buf, size)) < 0) {

Since the file system parsing code will not read past EOF but just return a 
short read instead. The file system parsing code will return a negative number 
for errors.

Comment 1 Alex Schuilenburg 2003-06-20 16:15:48 UTC
This bug has moved to http://bugs.ecos.sourceware.org/show_bug.cgi?id=64418


Note You need to log in before you can comment on or make changes to this bug.