Skip to content

Commit 3209f9d

Browse files
kattisrinivasanJames Bottomley
authored andcommitted
scsi: storvsc: Fix a bug in the handling of SRB status flags
SRB status can have additional information. Mask these out before processing SRB status. This patch was sent as part of a collection of patches more than a year ago. While the rest of the patches in the set were comitted, this patch was not. I woulod like to thank Olaf for noticing that this patch was not committed upstream. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Long Li <longli@microsoft.com> Signed-off-by: James Bottomley <JBottomley@Odin.com>
1 parent 81988a0 commit 3209f9d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/scsi/storvsc_drv.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,14 @@ enum storvsc_request_type {
349349
*/
350350

351351
#define SRB_STATUS_AUTOSENSE_VALID 0x80
352+
#define SRB_STATUS_QUEUE_FROZEN 0x40
352353
#define SRB_STATUS_INVALID_LUN 0x20
353354
#define SRB_STATUS_SUCCESS 0x01
354355
#define SRB_STATUS_ABORTED 0x02
355356
#define SRB_STATUS_ERROR 0x04
356357

358+
#define SRB_STATUS(status) \
359+
(status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN))
357360
/*
358361
* This is the end of Protocol specific defines.
359362
*/
@@ -858,7 +861,7 @@ static void storvsc_handle_error(struct vmscsi_request *vm_srb,
858861
void (*process_err_fn)(struct work_struct *work);
859862
bool do_work = false;
860863

861-
switch (vm_srb->srb_status) {
864+
switch (SRB_STATUS(vm_srb->srb_status)) {
862865
case SRB_STATUS_ERROR:
863866
/*
864867
* If there is an error; offline the device since all

0 commit comments

Comments
 (0)