Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using DmaFile::create without calling DmaFile::open first results in broken probe_iopoll_support check #670

Open
wyattpt opened this issue Jun 29, 2024 · 0 comments

Comments

@wyattpt
Copy link

wyattpt commented Jun 29, 2024

Creating a write-only file on a block device with DmaFile::create without calling DmaFile::open to open a file with read permissions beforehand causes probe_iopoll_support to always return false. This causes the iopoll property to be cached as false and disables polling for all files on the BlockDevice while the program is running.

Each time DmaFile::open_at is called, probe_iopoll_support is called to determine the PollableStatus. If iopoll support has not been verified for the BlockDevice, it will check for support by performing a read on the file. If the file is being opened for writing, the OS will return Bad file descriptor (os error 9), triggering an error message and disabling polling for any file opened on the BlockDevice, even if it supports polling.

Minimal reproduction

use glommio::{LocalExecutor, io::DmaFile};

fn main() {
    simple_logger::init().unwrap();

    let ex = LocalExecutor::default();
    ex.run(async {
        let file = DmaFile::create("/tmp/file.txt").await.unwrap();
        file.close().await.unwrap();
    });
}

Output:

ERROR [glommio::reactor] got unexpected error when probing iopoll support for file "/tmp/file.txt" (fd: 7) hosted on (259, 3); the poll ring will be disabled for this device: Bad file descriptor (os error 9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant