On Fri, 2018-10-19 at 02:24 -0400, Douglas Gilbert wrote:
> static void
> -sg_fill_request_table(struct sg_fd *sfp, struct sg_req_info *rinfo)
> +sg_fill_request_table(struct sg_fd *sfp, struct sg_req_info *rinfo,
> +                     int max_num)
>  {
>         struct sg_request *srp;
>         int val;
> -       unsigned int ms;
>  
>         val = 0;
> -       list_for_each_entry(srp, &sfp->rq_list, entry) {
> -               if (val >= SG_MAX_QUEUE)
> -                       break;
> -               rinfo[val].req_state = srp->done + 1;
> +       list_for_each_entry(srp, &sfp->rq_list, rq_entry) {
> +               if (val >= max_num)
> +                       return;

What protects the sfp->rq_list against concurrent changes? It seems to me
like all other code that iterates over or modifies that list protects that
list with rq_list_lock?

Thanks,

Bart.

Reply via email to