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

lxd/storage: Fix check for direct I/O write support #14157

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

simondeziel
Copy link
Member

No description provided.

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
@simondeziel simondeziel marked this pull request as ready for review September 25, 2024 13:13
@@ -1858,7 +1858,7 @@ func (b *lxdBackend) imageConversionFiller(imgPath string, imgFormat string, op
_ = from.Close()
}

to, err := os.OpenFile(diskPath, unix.O_DIRECT|unix.O_RDONLY, 0)
to, err := os.OpenFile(diskPath, unix.O_DIRECT|unix.O_WRONLY, 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this, we use O_RDONLY in ImageUnpack.

The aim is just to figure out if the underlying storage supports direct I/O, not to actually use the file handle.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question I don't know the answer for. Can direct I/O support be different for writing and reading?

If not, then why check both from and to?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NVM re from and to, they can be on different FS :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mihalicyn do you know if O_DIRECT support can vary between read and write accesses? I'm well outside of my depth here but after reading the commit description of https://github.com/openzfs/zfs/pull/10018/commits, I believe it would be prudent to test for both type of operations.

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

Successfully merging this pull request may close these issues.

2 participants