aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_debug.c
diff options
context:
space:
mode:
authorEwan D. Milne <[email protected]>2014-12-04 16:49:26 +0000
committerChristoph Hellwig <[email protected]>2014-12-15 12:34:26 +0000
commit4bc6b63482a069baa2eeaba3e4a0b5df75263dc5 (patch)
tree91459de2c97b39f534c43fddd19ffdcf421656be /drivers/scsi/scsi_debug.c
parentscsi_debug: improve driver description in Kconfig (diff)
downloadkernel-4bc6b63482a069baa2eeaba3e4a0b5df75263dc5.tar.gz
kernel-4bc6b63482a069baa2eeaba3e4a0b5df75263dc5.zip
scsi_debug: take sdebug_host_list_lock when changing capacity
All other traversals of the sdebug_host_list take the lock. Signed-off-by: Ewan D. Milne <[email protected]> Acked-by: Douglas Gilbert <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
-rw-r--r--drivers/scsi/scsi_debug.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 2e32a4c09fbc..0d0e0593e3c5 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -4438,6 +4438,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 +4447,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;
}