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)
Sep 28 2024, 4:35 PM
Unknown Object (File)
Sep 16 2024, 10:05 PM
Unknown Object (File)
Sep 4 2024, 4:50 AM
Unknown Object (File)
Sep 4 2024, 4:35 AM
Unknown Object (File)
Sep 1 2024, 11:41 AM
Unknown Object (File)
Aug 18 2024, 1:51 AM
Unknown Object (File)
Aug 12 2024, 8:25 AM
Unknown Object (File)
Aug 10 2024, 4:10 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 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.