Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4bc6b634 authored by Ewan D. Milne's avatar Ewan D. Milne Committed by Christoph Hellwig
Browse files

scsi_debug: take sdebug_host_list_lock when changing capacity



All other traversals of the sdebug_host_list take the lock.

Signed-off-by: default avatarEwan D. Milne <emilne@redhat.com>
Acked-by: default avatarDouglas Gilbert <dgilbert@interlog.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 6d6f3807
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
	}