On Sun, 15 Dec 2013, James Bottomley wrote: > No, I was thinking of the two thread scan bug (i.e. two scan threads) > not one scan and one remove, which is a bug in the old code. This is a > race between put and get when the kref is incremented from zero (an > illegal operation which triggers a warn on). > > The way to mediate this is to check for the kref already being zero > condition, like below. Yes, that seems reasonable. Consider now: Having done this, to what extent do starget->reap_ref and starget->state really need to be protected by the host_lock? Maybe only the linked lists require protection. (I haven't checked.) Can you post a single, combined patch incorporating all your proposed changes? It's little hard to review them in pieces... Alan Stern P.S.: Would you agree that the phrase "pretty astonishing cockup" did indeed turn out to be appropriate? :-) -- 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