Notice: We have migrated to GitLab launching 2024-05-01 see here:

#1271 closed defect (fixed)

[libblock, bdbuf] xfer-in-progress flag not reset if ioctl() fails

Reported by: strauman Owned by: Joel Sherrill
Priority: normal Milestone: 4.7
Component: lib/block Version: 4.7
Severity: normal Keywords:
Cc: chrisj@…, victor.vengerov@… Blocked By:


When casting out buffers, the swapout task
sets the buffer's 'in_progress' flag and clears 'modified'.

If the ioctl() command for scheduling the write operation
fails, any tasks waiting on the buffer are woken up but
the 'in_progress' flag remains set so that anybody
looping in find_or_assign_buffer() goes back to sleep.

In the normal case (ioctl successful) the ISR resets 'in_progress'
and wakes up the tasks waiting for the buffer.

FIX: if ioctl fails, in_progress must be reset to FALSE (and 'modified'
should be set to TRUE since the dirty buffer was not written).

Attachments (1)

bdbuf.c-swapout_ioctl_fail.diff (1.3 KB) - added by strauman on 01/06/08 at 04:45:51.
fix for the reported bug

Download all attachments as: .zip

Change History (3)

Changed on 01/06/08 at 04:45:51 by strauman

fix for the reported bug

comment:1 Changed on 08/06/08 at 03:28:35 by Chris Johns

Cc: Chris Johns added
Resolution: fixed
Status: newclosed

In the new bdbuf code if the writes fails the buffers are placed back onto the queue and the transfer tries again.

I do not think this is optimal but ignoring the error is also not great.

Suggestions for a solution are welcome.

The specific issue in the bug has been fixed. The state of the buffer is correctly handled in the new code.

comment:2 Changed on 10/10/17 at 06:49:19 by Sebastian Huber

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