#49 closed defect (fixed)

imfs_dir_lseek() works incorrect

Reported by: Joel Sherrill Owned by: Jennifer Averett
Priority: normal Milestone: 2
Component: fs Version: unknown
Severity: major Keywords:
Cc: bugs@…, joel.sherrill@… Blocked By:
Blocking:

Description

It seems that imfs_dir_lseek() works incorrect.
Now we have:

normal_offset = (offset/sizeof(struct dirent)) * sizeof(struct dirent);

switch( whence ) {

case SEEK_SET: /* absolute move from the start of the file */

iop->offset = normal_offset;
break;

case SEEK_CUR: /* relative move */

iop->offset = iop->offset + normal_offset;
break;

case SEEK_END: /* Movement past the end of the directory via lseek */

/* is not a permitted operation */

default:

set_errno_and_return_minus_one( EINVAL );
break;

}

But this was already done in lseek().
It seems that offset will be 2 times greater that should.

I propose to change all this to
iop->offset = (iop->offset/sizeof(struct dirent)) * sizeof(struct dirent);

Release:
RTEMS ss-20010816?

Environment:
NA

Attachments (1)

imfs_dir_lseek_patches.tgz (749 bytes) - added by Joel Sherrill on Dec 3, 2006 at 1:31:12 PM.
imfs_dir_lseek_patches.tgz

Download all attachments as: .zip

Change History (2)

comment:1 Changed on Nov 7, 2001 at 11:32:00 PM by Joel Sherrill

Status: assignedclosed

State-Changed-From-To: analyzed->closed
State-Changed-Why: Attached patches applied to CVS trunk and 4.5 branch.

Changed on Dec 3, 2006 at 1:31:12 PM by Joel Sherrill

Attachment: imfs_dir_lseek_patches.tgz added

imfs_dir_lseek_patches.tgz

Note: See TracTickets for help on using tickets.