Bug 194311

Summary: drivers/block/drbd/drbd_req.c do_submit condition fast path does not handle read as slow path
Product: Drivers Reporter: Michael (michael_allen_bond)
Component: OtherAssignee: drivers_other
Status: NEW ---    
Severity: normal    
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 4.10 Subsystem:
Regression: No Bisected commit-id:

Description Michael 2017-02-07 05:59:18 UTC
In submit_fast_path:

--->	if (rw == WRITE /* rw != WRITE should not even end up 			here! */
	    && req->private_bio && req->i.size
	    && !test_bit(AL_SUSPENDED, &device->flags)) {
	
	Is there any guarantee that do_submit doesn't receive read requests? There's a simple check for it in the fast path, but nothing in the slow path, why not implement the check in the  beginning of do_submit, since we check for it anyways, and this avoids needlessly calling extra functions.

Found using static analysis tools.