Page MenuHomeFreeBSD

add a knob that disables detection of write protected disks
ClosedPublic

Authored by avg on Dec 10 2018, 8:21 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Feb 17, 3:42 AM
Unknown Object (File)
Mon, Feb 17, 12:46 AM
Unknown Object (File)
Fri, Feb 14, 3:06 AM
Unknown Object (File)
Jan 1 2025, 5:52 AM
Unknown Object (File)
Dec 12 2024, 9:14 PM
Unknown Object (File)
Dec 11 2024, 4:27 PM
Unknown Object (File)
Dec 10 2024, 5:27 PM
Unknown Object (File)
Dec 4 2024, 4:29 AM
Subscribers
None

Details

Summary

It has been reported that on some systems (with real hardware passed
through to a virtual machine) the WP detection causes USB disk probing
failures.

Test Plan

Tested disk probing with WP detection on and off.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 21471
Build 20789: arc lint + arc unit

Event Timeline

While here, I also fixed setting of the next state in the case of malloc failure in DA_STATE_PROBE_WP.

correct description of the new sysctl

sys/cam/scsi/scsi_da.c
3342

wouldn't it be better to go directly to PROBE_RC* rather than have this useless trip through STATE_PROBE_WP?

avg marked 2 inline comments as done.Dec 15 2018, 1:59 PM
avg added inline comments.
sys/cam/scsi/scsi_da.c
3342

That's certainly another possibility to do it, but I am not sure if it's really better.
With respect to run-time execution the difference is negligible, in my opinion.
With respect to code organization da_disable_wp_detection would have to be checked in two places, daregister and dareprobe, instead of one. But that's a pretty minor difference as well.

So, I don't have a preference. I did it this way, but I can re-do it the other way.

3346

I wonder if there should be an inline function for choosing between DA_STATE_PROBE_RC16 and DA_STATE_PROBE_RC, given that the check is going to be repeated 3 or 4 times.

This revision was not accepted when it landed; it landed in state Needs Review.Dec 17 2018, 4:01 PM
This revision was automatically updated to reflect the committed changes.