search for: status_lock

Displaying 20 results from an estimated 26 matches for "status_lock".

Did you mean: status_block
2019 Apr 24
0
[nbdkit PATCH 1/4] server: Check for pthread lock failures
...letions(-) diff --git a/server/connections.c b/server/connections.c index a30a541..b7d9a6a 100644 --- a/server/connections.c +++ b/server/connections.c @@ -91,11 +91,13 @@ connection_get_status (struct connection *conn) { int r; - if (conn->nworkers) - pthread_mutex_lock (&conn->status_lock); + if (conn->nworkers && + pthread_mutex_lock (&conn->status_lock)) + abort (); r = conn->status; - if (conn->nworkers) - pthread_mutex_unlock (&conn->status_lock); + if (conn->nworkers && + pthread_mutex_unlock (&conn->status_...
2023 Mar 27
0
[PATCH] vdpa/mlx5: Avoid losing link state updates
...T_STATE_UP) > + return true; > + > + return false; > +} > + > +static void update_link_state(struct mlx5_vdpa_dev *mvdev) > +{ > + struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev); > + bool up; > + > + up = get_link_state(mvdev); > + spin_lock(&ndev->status_lock); > + if (up) > + ndev->config.status |= cpu_to_mlx5vdpa16(mvdev, VIRTIO_NET_S_LINK_UP); > + else > + ndev->config.status &= cpu_to_mlx5vdpa16(mvdev, ~VIRTIO_NET_S_LINK_UP); > + spin_unlock(&ndev->status_lock); > +} > + > static int mlx5_vdpa_set_driver_f...
2019 Apr 24
7
[nbdkit PATCH 0/4] More mutex sanity checking
I do have a question about whether patch 2 is right, or whether I've exposed a bigger problem in the truncate (and possibly other) filter, but the rest seem fairly straightforward. Eric Blake (4): server: Check for pthread lock failures truncate: Factor out reading real_size under mutex plugins: Check for mutex failures filters: Check for mutex failures filters/cache/cache.c
2017 Nov 17
8
[RFC nbdkit PATCH 0/6] Enable full parallel request handling
I want to make my nbd forwarding plugin fully parallel - but to do that, I first need to make nbdkit itself fully parallel ;) With this series, I was finally able to demonstrate out-of-order responses when using qemu-io (which is great at sending back-to-back requests prior to waiting for responses) coupled with the nbd file plugin (which has a great feature of rdelay and wdelay, to make it
2017 Nov 20
10
[nbdkit PATCH v2 0/8] Support parallel transactions within single connection
I've posted some of these patches or ideas before; but now I'm confident enough with the series that it should be ready to push; at any rate, I can now run test-socket-activation in a tight loop without triggering any crashes or hangs. With this in place, I'm going back to work on making the nbd forwarder wort with the parallel thread model. Eric Blake (8): sockets: Use
2018 Apr 12
3
[PATCH nbdkit 0/2] connections: Protect open and close callbacks with the request lock.
I'm fairly sure that these bugs which appear in the Python plugin: https://bugzilla.redhat.com/show_bug.cgi?id=1566516 https://bugzilla.redhat.com/show_bug.cgi?id=1566522 are really bugs in the SERIALIZE_ALL_REQUESTS thread model. See the first patch for the full explanation. The second patch is a fix for a race condition which is probably nudged into being by the first patch. Now this
2019 Aug 03
5
[nbdkit PATCH 0/3] More responsive shutdown
We noticed while writing various libnbd tests that when the delay filter is in use, there are scenarios where we had to resort to SIGKILL to get rid of nbdkit, because it was non-responsive to SIGINT. I'm still trying to figure out the best way to add testsuite coverage of this, but already proved to myself that it works from the command line, under two scenarios that both used to cause long
2019 Sep 10
0
[PATCH nbdkit] server: Add nbdkit_export_name() to allow export name to be read.
...e. + +=back + =head1 CALLBACKS =head2 C<.name> diff --git a/server/connections.c b/server/connections.c index b582764..a1fea54 100644 --- a/server/connections.c +++ b/server/connections.c @@ -385,6 +385,7 @@ free_connection (struct connection *conn) pthread_mutex_destroy (&conn->status_lock); free (conn->handles); + free (conn->exportname); free (conn); } diff --git a/server/internal.h b/server/internal.h index 9314e8f..3bfc1a7 100644 --- a/server/internal.h +++ b/server/internal.h @@ -180,6 +180,7 @@ struct connection { struct b_conn_handle *handles; size_t nr...
2018 Jan 17
0
[PATCH 5/9] connections: Allow multiple handles to be stored in the connection object.
...+-------------------------- 3 files changed, 59 insertions(+), 35 deletions(-) diff --git a/src/connections.c b/src/connections.c index e1ac543..51a9772 100644 --- a/src/connections.c +++ b/src/connections.c @@ -69,10 +69,12 @@ struct connection { pthread_mutex_t write_lock; pthread_mutex_t status_lock; int status; /* 1 for more I/O with client, 0 for shutdown, -1 on error */ - void *handle; void *crypto_session; int nworkers; + void **handles; + size_t nr_handles; + uint64_t exportsize; int readonly; int can_flush; @@ -100,16 +102,37 @@ static void raw_close (struct connec...
2018 Jan 19
0
[nbdkit PATCH v2 08/13] connections: Allow multiple handles to be stored in the connection object.
...+-------------------------- 3 files changed, 59 insertions(+), 35 deletions(-) diff --git a/src/connections.c b/src/connections.c index 7a4c7bb..e225b5c 100644 --- a/src/connections.c +++ b/src/connections.c @@ -69,10 +69,12 @@ struct connection { pthread_mutex_t write_lock; pthread_mutex_t status_lock; int status; /* 1 for more I/O with client, 0 for shutdown, -1 on error */ - void *handle; void *crypto_session; int nworkers; + void **handles; + size_t nr_handles; + uint64_t exportsize; int readonly; int can_flush; @@ -100,16 +102,37 @@ static void raw_close (struct connect...
2019 Sep 10
2
[PATCH nbdkit] server: Add nbdkit_export_name() to allow export name to be read.
This is the sort of thing I had in mind for option (1) here: https://www.redhat.com/archives/libguestfs/2019-September/msg00047.html It does reveal that the way we currently list exports is naive to say the least ... Rich.
2020 Aug 25
0
[nbdkit PATCH 3/5] api: Add nbdkit_string_intern helper
...E_NAME extern void crypto_init (bool tls_set_on_cli); diff --git a/server/connections.c b/server/connections.c index 67a68469..d9f685c9 100644 --- a/server/connections.c +++ b/server/connections.c @@ -360,7 +360,7 @@ free_connection (struct connection *conn) pthread_mutex_destroy (&conn->status_lock); free (conn->exportname_from_set_meta_context); - free (conn->exportname); + free_interns (); /* This is needed in order to free a field in struct handle. */ for_each_backend (b) diff --git a/server/main.c b/server/main.c index 17c4c324..9cb12b59 100644 --- a/server/main.c +++ b...
2020 Aug 27
0
[nbdkit PATCH v2 4/8] api: Add nbdkit_str[n]dup_intern helper
...E_NAME extern void crypto_init (bool tls_set_on_cli); diff --git a/server/connections.c b/server/connections.c index 67a68469..d9f685c9 100644 --- a/server/connections.c +++ b/server/connections.c @@ -360,7 +360,7 @@ free_connection (struct connection *conn) pthread_mutex_destroy (&conn->status_lock); free (conn->exportname_from_set_meta_context); - free (conn->exportname); + free_interns (); /* This is needed in order to free a field in struct handle. */ for_each_backend (b) diff --git a/server/main.c b/server/main.c index 17c4c324..ae552447 100644 --- a/server/main.c +++ b...
2019 Sep 12
4
[PATCH nbdkit v2 0/3] Access export name from plugins.
The previous incomplete patch was here: https://www.redhat.com/archives/libguestfs/2019-September/msg00049.html based on earlier discussion here: https://www.redhat.com/archives/libguestfs/2019-September/msg00047.html In v2: - The previous patch was incomplete. This version completes it by adding tests and extending nbdkit-sh-plugin. - nbdkit_export_name now returns NULL for error,
2019 Mar 18
3
[PATCH nbdkit 0/2] server: Split out NBD protocol code from connections code.
These are a couple of patches in preparation for the Block Status implementation. While the patches (especially the second one) are very large they are really just elementary code motion. Rich.
2019 Jun 07
4
[nbdkit PATCH v2 0/2] Reduce network overhead with MSG_MORE/corking
This time around, the numbers are indeed looking better than in v1; and I like the interface better. Eric Blake (2): server: Prefer send() over write() server: Group related transmission send()s server/internal.h | 7 +++- server/connections.c | 51 +++++++++++++++++++++++++--- server/crypto.c | 11 ++++--
2019 Sep 28
11
[nbdkit PATCH v2 0/7] Spec compliance patches
Since the v1 series (0/4, at [1]), I've applied patches 1 and 2, rewritten patch 3 [Forbid NUL in export and context names] into patch 4 here, patch 4 there turned into patch 6 here, and everything else here is new. [1]https://www.redhat.com/archives/libguestfs/2019-September/msg00180.html I don't know if there is a handy reusable function for checking whether a string contains valid
2020 Jul 21
4
[PATCH nbdkit] server: Pass the export name through filter .open calls.
...} diff --git a/server/connections.c b/server/connections.c index cc552b90..69e4c0c0 100644 --- a/server/connections.c +++ b/server/connections.c @@ -356,6 +356,8 @@ free_connection (struct connection *conn) pthread_mutex_destroy (&conn->write_lock); pthread_mutex_destroy (&conn->status_lock); + free (conn->exportname_from_set_meta_context); + free (conn->exportname); free (conn->handles); free (conn); threadlocal_set_conn (NULL); diff --git a/server/filters.c b/server/filters.c index 2d705e1e..7d268096 100644 --- a/server/filters.c +++ b/server/filters.c @@ -238,...
2019 Mar 18
0
[PATCH nbdkit 2/2] server: Split out NBD protocol code from connections code.
.... - * For convenience, return the incoming value. */ -static int -set_status (struct connection *conn, int value) + * For convenience, return the incoming value. + */ +int +connection_set_status (struct connection *conn, int value) { if (conn->nworkers) pthread_mutex_lock (&conn->status_lock); @@ -150,8 +132,8 @@ connection_worker (void *data) threadlocal_set_name (name); free (worker); - while (!quit && get_status (conn) > 0) - recv_request_send_reply (conn); + while (!quit && connection_get_status (conn) > 0) + protocol_recv_request_send_reply (c...
2020 Aug 25
9
[nbdkit PATCH 0/5] Implement .default_export, nbdkit_string_intern
More patches on the way for improving .list_exports signature and adding .export_description, but this is the promised code showing why nbdkit_string_intern is useful. Patch 4 is somewhat RFC: we could either add new API to take the boilerplate from: foo_config(const char *key, const char *value) { if (strcmp (key, "file") == 0) { CLEANUP_FREE char *tmp = nbdkit_realpath (value);