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)
Jan 16 2024, 1:08 AM
Unknown Object (File)
Dec 14 2023, 6:43 PM
Unknown Object (File)
Nov 25 2023, 6:22 PM
Unknown Object (File)
Jun 30 2023, 6:25 PM
Unknown Object (File)
Jun 15 2023, 11:42 PM
Unknown Object (File)
May 13 2023, 3:40 AM
Unknown Object (File)
May 6 2023, 2:48 PM
Unknown Object (File)
Mar 25 2023, 6:54 AM
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.