googlefs: fix a possible race condition
This commit is contained in:
parent
747e0ba247
commit
2e04b3a2b9
@ -1365,11 +1365,11 @@ int googlefs_open_query(fs_volume *_volume, const char *query, ulong flags,
|
|||||||
UNLOCK(&ns->l);
|
UNLOCK(&ns->l);
|
||||||
reuse:
|
reuse:
|
||||||
/* put the chocolate on the cookie */
|
/* put the chocolate on the cookie */
|
||||||
|
c->node = qn;
|
||||||
LOCK(&qn->l);
|
LOCK(&qn->l);
|
||||||
SLL_INSERT(qn->opened, next, c);
|
SLL_INSERT(qn->opened, next, c);
|
||||||
UNLOCK(&qn->l);
|
UNLOCK(&qn->l);
|
||||||
qn->qcompleted = 1; /* tell other cookies we're done */
|
qn->qcompleted = 1; /* tell other cookies we're done */
|
||||||
c->node = qn;
|
|
||||||
*cookie = c;
|
*cookie = c;
|
||||||
free(qstring);
|
free(qstring);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
Loading…
Reference in New Issue
Block a user