On Fri, 2018-10-19 at 15:55 -0400, Douglas Gilbert wrote: +AD4 On 2018-10-19 11:22 a.m., Bart Van Assche wrote: +AD4 +AD4 On Fri, 2018-10-19 at 02:24 -0400, Douglas Gilbert wrote: +AD4 +AD4 +AD4 static void +AD4 +AD4 +AD4 -sg+AF8-fill+AF8-request+AF8-table(struct sg+AF8-fd +ACo-sfp, struct sg+AF8-req+AF8-info +ACo-rinfo) +AD4 +AD4 +AD4 +-sg+AF8-fill+AF8-request+AF8-table(struct sg+AF8-fd +ACo-sfp, struct sg+AF8-req+AF8-info +ACo-rinfo, +AD4 +AD4 +AD4 +- int max+AF8-num) +AD4 +AD4 +AD4 +AHs +AD4 +AD4 +AD4 struct sg+AF8-request +ACo-srp+ADs +AD4 +AD4 +AD4 int val+ADs +AD4 +AD4 +AD4 - unsigned int ms+ADs +AD4 +AD4 +AD4 +AD4 +AD4 +AD4 val +AD0 0+ADs +AD4 +AD4 +AD4 - list+AF8-for+AF8-each+AF8-entry(srp, +ACY-sfp-+AD4-rq+AF8-list, entry) +AHs +AD4 +AD4 +AD4 - if (val +AD4APQ SG+AF8-MAX+AF8-QUEUE) +AD4 +AD4 +AD4 - break+ADs +AD4 +AD4 +AD4 - rinfo+AFs-val+AF0.req+AF8-state +AD0 srp-+AD4-done +- 1+ADs +AD4 +AD4 +AD4 +- list+AF8-for+AF8-each+AF8-entry(srp, +ACY-sfp-+AD4-rq+AF8-list, rq+AF8-entry) +AHs +AD4 +AD4 +AD4 +- if (val +AD4APQ max+AF8-num) +AD4 +AD4 +AD4 +- return+ADs +AD4 +AD4 +AD4 +AD4 What protects the sfp-+AD4-rq+AF8-list against concurrent changes? It seems to me +AD4 +AD4 like all other code that iterates over or modifies that list protects that +AD4 +AD4 list with rq+AF8-list+AF8-lock? +AD4 +AD4 Bart, +AD4 The function is called from sg+AF8-ioctl() case SG+AF8-GET+AF8-REQUEST+AF8-TABLE and at the +AD4 call point the read+AF8-lock is held on rq+AF8-list+AF8-lock. Maybe I can add a comment +AD4 above the function about the lock being held. +AFs-At least it is as the end +AD4 of the patch series, and that is all I care about :-)+AF0 Hi Doug, Thanks for the clarification. How about adding a +AF8AXw-must+AF8-hold() annotation? Bart.