#1486 closed defect

Reset of all hold timers when sync_active in rtems_bdbuf_swapout_modified_processing() might be not correct

Reported by: Oleg Owned by: Sebastian Huber
Priority: normal Milestone: 4.10.3
Component: lib/block Version: 4.10
Severity: normal Keywords:
Cc: thomas.doerfler@…, chrisj@…, nbkolchin@…, sebastian.huber@… Blocked By:
Blocking:

Description (last modified by Gedare Bloom)

In rtems_bdbuf_swapout_modified_processing() function there are following lines:
if (sync_active)

bd->hold_timer = 0;

I.e. in case of calling rtems_bdbuf_sync() for a PARTICULAR device DEV1, we will reset hold timer of ALL modified buffers, which is not a desired behaviour.

If we have a look at next lines of this function we will see that "transfer" list is populated with a buffer entry only when:
"if (bd->dev == *dev)"
condition is true.

This means that on the next swapout timeout all previously reset buffers will be written to a disk.

Now imagine that we have VERY slow block device for whose we configured VERY BIG swap hold timer value in order to do disk sync rarely, and we do sync on another disk device. This sync will cause sync on ALL devices.

What do you think about it?

Change History (6)

comment:1 Changed on Dec 21, 2009 at 2:39:27 PM by Oleg

Summary: all hold timers when sync_active in rtems_bdbuf_swapout_modified_processing() might be not correctReset of all hold timers when sync_active in rtems_bdbuf_swapout_modified_processing() might be not correct

comment:2 Changed on Dec 27, 2009 at 1:04:26 AM by Chris Johns

Yes this is a bug.

If the dev when entering the function is RTEMS_INVALID_DEV all devices are being sync'ed. The code should check sync_active for true and then dev and set the timer to 0 if the device matches or all devices.

comment:3 Changed on Nov 22, 2014 at 1:48:28 PM by Gedare Bloom

Description: modified (diff)
Milestone: 4.104.10.3

comment:4 Changed on Nov 24, 2014 at 3:00:50 PM by Joel Sherrill

Owner: changed from Joel Sherrill to Sebastian Huber
Status: newassigned

comment:5 Changed on Nov 27, 2014 at 1:19:45 PM by Sebastian Huber

Resolution: fixed
Status: assignedclosed

comment:6 Changed on Oct 10, 2017 at 6:49:19 AM by Sebastian Huber

Component: fslib/block
Note: See TracTickets for help on using tickets.