On 9/11/20 5:47 PM, Brian Bunker wrote:
To me just removing the h->sdev = NULL seems strange because then this looks strange to me: pg = rcu_dereference_protected(h->pg, lockdep_is_held(&h->pg_lock)); rcu_assign_pointer(h->pg, NULL); Then saying If (pg) Since we just assigned that pointer, h->pg to NULL.
True, but the 'rcu_dereference()' call is just ensuring 'alua_dh_data' is valid, not the contents of which. So to be absolutely correctly we would need to take 'h->lock' when evaluating 'h->sdev'; but then this is an optimisation anyway we might as well kill the BUG_ON() and replace it by a simple 'if' condition.
Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@xxxxxxx +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer