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

Potential off-by-one in offset handling of TRIM command #7

Closed
NicolasT opened this issue Nov 21, 2012 · 1 comment
Closed

Potential off-by-one in offset handling of TRIM command #7

NicolasT opened this issue Nov 21, 2012 · 1 comment

Comments

@NicolasT
Copy link

While playing around with the "TRIM" support, I found it nothing happens when using offset 0 (using nbd-server). I think exptrim contains an off-by-one bug:

if(prev.startoff < req->from) {

should be

if(prev.startoff <= req->from) {

Although, that's my suspicion. Only confirmed to work for a single-file export.

@yoe
Copy link
Member

yoe commented Nov 21, 2012

Yes, you're right; that's an off-by-one.

I must admit that the TRIM code hasn't been tested much. I implemented it before the support for it was in the kernel, and my tester client doesn't try it...

@yoe yoe closed this as completed Nov 21, 2012
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

2 participants