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

Figure out what to do about negative offsets when reading/writing #839

Open
SuchAFuriousDeath opened this issue Apr 16, 2024 · 7 comments
Open
Labels
T-enhancement Type: Enhancement

Comments

@SuchAFuriousDeath
Copy link
Contributor

I remember from somewhere that FreeBSD allows negative offsets for devices, but our offset field is currently an u64.

@ultimaweapon
Copy link
Member

Strange. I though FreeBSD is going to ignore the offset instead of using its negative value.

@SuchAFuriousDeath
Copy link
Contributor Author

Ignore it where?

@ultimaweapon
Copy link
Member

I don't know. It just my guess because a read/write to a device should not requires an offset.

@SuchAFuriousDeath
Copy link
Contributor Author

I'm not saying it requires an offset. But the uio struct contains an offset field and in pwritev FreeBSD allows negative offsets (and we do too)
image

@ultimaweapon
Copy link
Member

I'm not saying it requires an offset. But the uio struct contains an offset field and in pwritev FreeBSD allows negative offsets (and we do too) image

The real purpose of this code should be not allowed a negative offset for non-device. What I suspect it FreeBSD will ignore the offset when reading or writing a device.

@SuchAFuriousDeath
Copy link
Contributor Author

Sure, but how does that relate to this issue? :D You left a todo!() in the code and we have to deal with it somehow.

@ultimaweapon
Copy link
Member

What we need to do is find a device that use this offset when reading or writing. If none of the devices used it we can remove it from the parameters.

@ultimaweapon ultimaweapon added the T-enhancement Type: Enhancement label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-enhancement Type: Enhancement
Development

No branches or pull requests

2 participants