Bug 64418 - load -m disk truncates files loaded
load -m disk truncates files loaded
Status: CLOSED WONTFIX
Product: eCos
Classification: Retired
Component: RedBoot (Show other bugs)
CVS
All Linux
medium Severity medium
: ---
: ---
Assigned To: eCos bugs internal list
eCos bugs internal list
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-05-03 22:07 EDT by Need Real Name
Modified: 2007-04-18 12:42 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-06-20 12:15:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2002-05-03 22:07:08 EDT
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 12:15:48 EDT
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.