浏览代码

[SCSI] set resid in scsi_io_completion() even for check condition

Some targets can return both valid data and sense information.
Always update the request data_len from the SCSI command residual.
Callers should interpret sense data to determine what parts of the
data are valid in case of a CHECK CONDITION status.

Signed-off-by: Pete Wyckoff <pw@osc.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Pete Wyckoff 18 年之前
父节点
当前提交
b22f687dd2
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      drivers/scsi/scsi_lib.c

+ 2 - 2
drivers/scsi/scsi_lib.c

@@ -848,8 +848,8 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
 				memcpy(req->sense, cmd->sense_buffer,  len);
 				memcpy(req->sense, cmd->sense_buffer,  len);
 				req->sense_len = len;
 				req->sense_len = len;
 			}
 			}
-		} else
-			req->data_len = cmd->resid;
+		}
+		req->data_len = cmd->resid;
 	}
 	}
 
 
 	/*
 	/*