Skip to content

OQueue Panics when Cursor Underflows #229

@ioeddk

Description

@ioeddk

OQueue panics in the following scenario:

  1. During the boot, there weren't enough BioCompletionStat entries in the BioCompletionOQueue.
  2. However, the LinnOS policy always attempts to peak four elements in the BioCompletionOQueue.
  3. While there are fewer than four elements in BioCompletionOQueue, the Cursor with usize as its type has self.0 - rhs less than 0, which causes panic immediately.
pub struct Cursor(usize);

impl Sub<usize> for Cursor {
    type Output = Cursor;

    fn sub(self, rhs: usize) -> Self::Output {
        Cursor(self.0 - rhs)
    }
}

#228 is a temporary solution to bypass the panic. But the first few OQueue reads might not return reliable values.

@arthurp Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions