On 12/01/16 17:49, tang.jun...@zte.com.cn wrote:
>> Bart wrote:
>> Please drop this patch. I think the alua_rtpg_queue() caller should
>> ensure that pg != NULL.
>
> Failure may also be occurred in queue_delayed_work(),
> since it would cause serious problems,
> so I think we are worth checking for it.

Hello Tang,

Have you been able to trigger the condition explained in the patch 
description or is this only something you think that can happen based on 
your interpretation of the source code? My comments about the checks 
that have been added are:
* All alua_rtpg_queue() callers pass a non-NULL pointer as first 
argument which means that the return statement under "if (!pg)" in 
alua_rtpg_queue() is never executed.
* Even if queue_delayed_work() returns 0 the qdata work passed to 
alua_rtpg_queue() is still added to the pg->rtpg_list and hence will be 
executed once the delayed work is executed. So I think that the 
condition you described (fn() not called) cannot happen. From 
alua_rtpg_work():

        list_splice_init(&pg->rtpg_list, &qdata_list);
         [ ... ]
        list_for_each_entry_safe(qdata, tmp, &qdata_list, entry) {
                list_del(&qdata->entry);
                if (qdata->callback_fn)
                        qdata->callback_fn(qdata->callback_data, err);
                kfree(qdata);
        }

Bart.

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to