ipr: wait for aborted command responses
[cascardo/linux.git] / drivers / scsi / scsi_debug.c
index 2e32a4c..7b8b51b 100644 (file)
@@ -816,6 +816,7 @@ static int check_readiness(struct scsi_cmnd *SCpnt, int uas_only,
                                        UA_CHANGED_ASC, CAPACITY_CHANGED_ASCQ);
                        if (debug)
                                cp = "capacity data changed";
+                       break;
                default:
                        pr_warn("%s: unexpected unit attention code=%d\n",
                                __func__, k);
@@ -4438,6 +4439,7 @@ static ssize_t virtual_gb_store(struct device_driver *ddp, const char *buf,
                        struct sdebug_host_info *sdhp;
                        struct sdebug_dev_info *dp;
 
+                       spin_lock(&sdebug_host_list_lock);
                        list_for_each_entry(sdhp, &sdebug_host_list,
                                            host_list) {
                                list_for_each_entry(dp, &sdhp->dev_info_list,
@@ -4446,6 +4448,7 @@ static ssize_t virtual_gb_store(struct device_driver *ddp, const char *buf,
                                                dp->uas_bm);
                                }
                        }
+                       spin_unlock(&sdebug_host_list_lock);
                }
                return count;
        }