#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:
Blocking:

Description

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 Jan 6, 2008 at 4:45:51 AM.
fix for the reported bug

Download all attachments as: .zip

Change History (3)

Changed on Jan 6, 2008 at 4:45:51 AM by strauman

fix for the reported bug

comment:1 Changed on Aug 6, 2008 at 3:28:35 AM 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 Oct 10, 2017 at 6:49:19 AM by Sebastian Huber

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