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.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 29, 1:00 AM
Unknown Object (File)
Thu, Jun 25, 1:32 PM
Unknown Object (File)
Sun, Jun 21, 12:56 PM
Unknown Object (File)
Jun 5 2026, 11:27 AM
Unknown Object (File)
May 26 2026, 8:59 AM
Unknown Object (File)
May 26 2026, 8:55 AM
Unknown Object (File)
May 21 2026, 9:02 AM
Unknown Object (File)
May 17 2026, 6:55 PM
Subscribers

Details

Reviewers
imp
Summary

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

Diff Detail

Lint
Lint Skipped
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.