#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 12/21/09 at 14:39:27 by Oleg
Summary: | all hold timers when sync_active in rtems_bdbuf_swapout_modified_processing() might be not correct → Reset of all hold timers when sync_active in rtems_bdbuf_swapout_modified_processing() might be not correct |
---|
comment:2 Changed on 12/27/09 at 01:04:26 by Chris Johns
comment:3 Changed on 11/22/14 at 13:48:28 by Gedare Bloom
Description: | modified (diff) |
---|---|
Milestone: | 4.10 → 4.10.3 |
comment:4 Changed on 11/24/14 at 15:00:50 by Joel Sherrill
Owner: | changed from Joel Sherrill to Sebastian Huber |
---|---|
Status: | new → assigned |
comment:5 Changed on 11/27/14 at 13:19:45 by Sebastian Huber
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed with [8aa608df3241d07de26d8700ce762476a09a7706/rtems].
comment:6 Changed on 10/10/17 at 06:49:19 by Sebastian Huber
Component: | fs → lib/block |
---|
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.