Re: [PATCH V2] scsi: fix race on creating sense cache

2019-07-16 Thread Martin K. Petersen
Ming, > When scsi_init_sense_cache(host) is called concurrently from different > hosts, each code path may see that the cache isn't created, then try > to create a new one, then the created sense cache may be overrided and > leaked. > > Fixes the issue by moving 'mutex_lock(&scsi_sense_cache_mut

[PATCH V2] scsi: fix race on creating sense cache

2019-07-11 Thread Ming Lei
When scsi_init_sense_cache(host) is called concurrently from different hosts, each code path may see that the cache isn't created, then try to create a new one, then the created sense cache may be overrided and leaked. Fixes the issue by moving 'mutex_lock(&scsi_sense_cache_mutex)' before scsi_sel