|
@@ -435,6 +435,12 @@ void coroutine_fn v9fs_reclaim_fd(V9fsPDU *pdu)
|
|
|
GHashTableIter iter;
|
|
|
gpointer fid;
|
|
|
|
|
|
+ /* prevent multiple coroutines running this function simultaniously */
|
|
|
+ if (s->reclaiming) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ s->reclaiming = true;
|
|
|
+
|
|
|
g_hash_table_iter_init(&iter, s->fids);
|
|
|
|
|
|
QSLIST_HEAD(, V9fsFidState) reclaim_list =
|
|
@@ -510,6 +516,8 @@ void coroutine_fn v9fs_reclaim_fd(V9fsPDU *pdu)
|
|
|
*/
|
|
|
put_fid(pdu, f);
|
|
|
}
|
|
|
+
|
|
|
+ s->reclaiming = false;
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -4324,6 +4332,8 @@ int v9fs_device_realize_common(V9fsState *s, const V9fsTransport *t,
|
|
|
s->ctx.fst = &fse->fst;
|
|
|
fsdev_throttle_init(s->ctx.fst);
|
|
|
|
|
|
+ s->reclaiming = false;
|
|
|
+
|
|
|
rc = 0;
|
|
|
out:
|
|
|
if (rc) {
|