#2353 assigned defect

Error in imfs memfile when device is full

Reported by: Joel Sherrill Owned by: Needs Funding
Priority: normal Milestone: Indefinite
Component: fs Version: 4.11
Severity: normal Keywords:
Cc: skruglov@… Blocked By:
Blocking:

Description

From the reporter (Круглов Сергей <skruglov@…>):

  • First bug I detect with attempt write file to full device (zero empty blocks).
  • And after I send too many files, disk overflow and system not responding (receive and write to disk have high priority). A test, and found block=0, after -- = too big value.
  • In imfs_memfile.c

function IMFS_memfile_extend
block declared: unsigned int block, and after block— work incorrect (if block = 0).
for ( ; block>=old_blocks ; block-- ) {

IMFS_memfile_remove_block( memfile, block );

}

Must be declare int block;

Attachments (1)

patch-1.txt (528 bytes) - added by Joel Sherrill on May 27, 2015 at 6:59:58 PM.
Proposed patch

Download all attachments as: .zip

Change History (4)

Changed on May 27, 2015 at 6:59:58 PM by Joel Sherrill

Attachment: patch-1.txt added

Proposed patch

comment:1 Changed on Jan 26, 2017 at 7:16:00 AM by Sebastian Huber

Milestone: 4.11.14.11.2

comment:2 Changed on Feb 2, 2017 at 3:08:08 PM by Gedare

The basic problem here is that block == 0 == old_blocks. Is it valid to call IMFS_memfile_remove_block( memfile, 0 )? If so then changing unsigned to signed is a fine solution.

comment:3 Changed on Feb 15, 2017 at 1:37:51 PM by Sebastian Huber

Milestone: 4.11.2Indefinite
Owner: set to Needs Funding
Status: newassigned
Note: See TracTickets for help on using tickets.