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)
Tue, Apr 9, 11:16 AM
Unknown Object (File)
Tue, Apr 9, 9:21 AM
Unknown Object (File)
Thu, Apr 4, 2:01 PM
Unknown Object (File)
Jan 17 2024, 10:13 PM
Unknown Object (File)
Dec 27 2023, 1:18 AM
Unknown Object (File)
Dec 22 2023, 11:07 PM
Unknown Object (File)
Dec 22 2023, 3:41 PM
Unknown Object (File)
Dec 14 2023, 11:28 PM
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 21472
Build 20790: 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
3343

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
3343

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.

3347

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.