Re: [PATCH] scsi: rescan VPD attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/26/2015 06:07 AM, Seymour, Shane M wrote:
> Hi Hannes,
> 
> I have one probably small nitpick about the patch. I'm not sure how likely what I've put below is likely
> to happen in real life though.
> 
> Is there any chance at all that sdev->vpd_pg83_len could change when updated?
> If there's any chance of that I'd have expected that both the
length of and the pointer to the vpd data
> would need to be protected not just the pointer so someone would
have a consistent picture of the vpd
> and its length. Without that there is a race where someone could
be using a new length with the old vpd
> data. That leaves the potential for a length that exceeds the vpd
size if the new data is larger than
> the old data - I don't know how likely it is but wanted to at
least bring it up as something to consider.
> 
Accesses to vpd_pgXX are rcu-protected, so we're ensured that we
always see a _valid_ copy. And we know that integer updates are
atomic, so we will always see a valid number in vpd_pgXX_len.
Both, vpd_pgXX and vpd_pgXX_len, are updated at the same place, and
under the same locks/mutexes. And as we're calling
'synchronize_rcu()' after updating vpd_pgXX, which needs to
synchronize against all CPUs, I would think that this would take
care of updating vpd_pgXX_len, too.

But you are right, we can get rid of vpd_pgXX_len and calculate it
from the data.
However, I'd like to do this with another patch after the ALUA
changes are in.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		               zSeries & Storage
hare@xxxxxxx			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux