Page MenuHomeFreeBSD

Don't return bogus success from DIOCGDELETE ioctl when bailing out due to a signal
Needs ReviewPublic

Authored by ron.steinke_dell.com on Jun 25 2021, 7:16 PM.

Details

Reviewers
imp
Summary

Current code bails out, but doesn't set an error. Set error to EINTR.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

ron.steinke_dell.com created this revision.
sys/geom/geom_dev.c
715

Why add a length check?

rang_acm.org added inline comments.
sys/geom/geom_dev.c
715

If the length is 0, we’ll be exiting anyway, and the DELETE operation has completed, so the EINTR wouldn’t convey any useful information. At least, that’s my guess.

sys/geom/geom_dev.c
715

Currently if you get signal during the last BIO_DELETE biodone(), you'll succeed. That's correct, as you've done all the work by the time you get the signal. Add the length check to avoid an unnecessary EINTR failure in that case.

This also means deletes which are small enough to only need a single pass will never see EINTR here, which may help preserve existing behavior for some cases.