Displaying 20 results from an estimated 31 matches for "send_reply".
2017 Feb 20
1
Re: Fwd: nbdkit async
...ork. While our plugin waits for the read or write data we don't block
in a thread we handle other requests that are ready).
The current nbdkit server design requires a thread per request in progress
because it is built around a synchronous callback to the plugin layer and
the main recv_request_send_reply loop holds the only copy of the request
handle that is needed to make the reply.
A more flexible design would be the recv_request_send_reply loop is instead
split into a recv_request loop and a send_reply func. The recv_request loop
forwards the request handle to the handle_request call. The exist...
2017 Nov 17
0
[nbdkit PATCH 3/6] connections: Add read/write lock over client I/O
...est_lock);
+ pthread_mutex_destroy (&conn->read_lock);
+ pthread_mutex_destroy (&conn->write_lock);
/* Don't call the plugin again if quit has been set because the main
* thread will be in the process of unloading it. The plugin.unload
@@ -888,19 +894,23 @@ recv_request_send_reply (struct connection *conn)
CLEANUP_FREE char *buf = NULL;
/* Read the request packet. */
+ pthread_mutex_lock (&conn->read_lock);
r = conn->recv (conn, &request, sizeof request);
if (r == -1) {
nbdkit_error ("read request: %m");
+ pthread_mutex_unlock (&...
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
2005 Aug 04
0
[PATCH 6/11] Xenstore watch rework
...tions, list) {
if (i->domain)
continue;
- if (!i->blocked)
+ if (i->state == OK)
FD_SET(i->fd, inset);
if (i->out)
FD_SET(i->fd, outset);
@@ -471,8 +471,7 @@
return i;
}
-/* Returns "false", meaning "connection is not blocked". */
-bool send_reply(struct connection *conn, enum xsd_sockmsg_type type,
+void send_reply(struct connection *conn, enum xsd_sockmsg_type type,
const void *data, unsigned int len)
{
struct buffered_data *bdata;
@@ -493,16 +492,15 @@
conn->waiting_reply = bdata;
} else
conn->out = bdata;
- return fal...
2017 Nov 17
2
Re: [nbdkit PATCH 3/6] connections: Add read/write lock over client I/O
...ex_destroy (&conn->read_lock);
> + pthread_mutex_destroy (&conn->write_lock);
>
> /* Don't call the plugin again if quit has been set because the main
> * thread will be in the process of unloading it. The plugin.unload
> @@ -888,19 +894,23 @@ recv_request_send_reply (struct connection *conn)
> CLEANUP_FREE char *buf = NULL;
>
> /* Read the request packet. */
> + pthread_mutex_lock (&conn->read_lock);
> r = conn->recv (conn, &request, sizeof request);
> if (r == -1) {
> nbdkit_error ("read request: %m&q...
2020 Sep 07
4
NT_STATUS_NETWORK_SESSION_EXPIRED
...mounts become inaccessible. GNOME
Nautilus gives error "invalid argument".
GVFS debug log shows
smbc_stat(smb://fileserver.domain.co.uk/share)
SMBC_getatr: sending qpathinfo
map_errno_from_nt_status: 32 bit codes: code=c000035c
smbc errno NT_STATUS_NETWORK_SESSION_EXPIRED -> 22
smb: send_reply(0x7fb930002840), failed=1 (Invalid argument)
smb: backend_dbus_handler org.gtk.vfs.Mount:QueryInfo (pid=24714)
smb: Queued new job 0x7fb924007700 (GVfsJobQueryInfo)
These Linux desktops also mount shares from a Windows Server 2012
server, using gio mount, and do not experience the same issue. Onl...
2017 Feb 19
2
Fwd: nbdkit async
----- Forwarded message -----
Date: Sat, 18 Feb 2017 22:21:19 -0500
Subject: nbdkit async
Hello,
Hope this is the right person to contact regarding nbdkit design.
I have a high latency massively parallel device that I am currently
implementing as an nbdkit plugin in c++ and have run into some design
limitations due to the synchronous callback interface nbdkit requires.
Nbdkit is currently
2017 Nov 15
3
[nbdkit PATCH 0/2] Better response to bogus NBD_CMD_READ
When facing a malicious client that is sending bogus NBD_CMD_READ,
we should make sure that we never end up in a situation where we
could try to treat the tail from a command that we diagnosed as
bad as being further commands.
Eric Blake (2):
connections: Report mid-message EOF as fatal
connections: Hang up early on insanely large WRITE requests
src/connections.c | 35
2019 Apr 23
0
[PATCH nbdkit v2 2/2] server: Use a thread-local pread/pwrite buffer to avoid leaking heap data.
...+extern void *threadlocal_buffer (size_t size);
/* Declare program_name. */
#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME == 1
diff --git a/server/protocol.c b/server/protocol.c
index 3f89f6d..9e8eea5 100644
--- a/server/protocol.c
+++ b/server/protocol.c
@@ -611,7 +611,7 @@ protocol_recv_request_send_reply (struct connection *conn)
uint16_t cmd, flags;
uint32_t magic, count, error = 0;
uint64_t offset;
- CLEANUP_FREE char *buf = NULL;
+ char *buf;
CLEANUP_EXTENTS_FREE struct nbdkit_extents *extents = NULL;
/* Read the request packet. */
@@ -656,12 +656,12 @@ protocol_recv_request_s...
2007 Sep 17
4
Xenstored: eliminate double free and fixes for memory leak
...there is error. This is inconsistent. Moreover,
the conn is freed again upon exit from handle_input(), inside the
main.
b. Another problem is that perms_to_strings() returned a allocated
memory (via realloc()). The only time the value is returned is in
do_get_perms(), but immediately after send_reply(), the pointer is
immediately thrown away, resulting in a memory leak condition, as
send_reply() does not free any memory.
c. Many of the functions like read_node(), get_parent(),
talloc_asprintf() etc all will allocate memory and return a pointer
when memory is allocated, but many times these a...
2018 Jan 19
2
Re: [nbdkit PATCH v2 13/13] RFC: plugins: Add callbacks for FUA semantics
...been changed to be in line with our other
internal projects.
I have uploaded the entire cbdkit source to our github at
https://github.com/dev-cloudbd/cbdkit
The relevant files are
include/cbdkit-plugin.h
src/connections.c
src/plugins.c
Specifically, the connections.c functions
recv_request
send_reply
and the plugins.c functions
plugin_pread
plugin_pwrite
cbdkit_async_reply
cbdkit_async_reply_read
cbdkit_async_reply_error
On Fri, Jan 19, 2018 at 12:05 PM, Eric Blake <eblake@redhat.com> wrote:
> On 01/19/2018 10:56 AM, Shaun McDowell wrote:
>
> > Limitation: The kernel...
Re: [PATCH nbdkit v2 2/2] server: Use a thread-local pread/pwrite buffer to avoid leaking heap data.
2019 Apr 23
1
Re: [PATCH nbdkit v2 2/2] server: Use a thread-local pread/pwrite buffer to avoid leaking heap data.
...perror ("malloc");
> error = ENOMEM;
Old code called perror() when nbdkit_extents_new() failed...
> if (cmd == NBD_CMD_WRITE &&
> skip_over_write_buffer (conn->sockin, count) < 0)
> @@ -673,8 +673,10 @@ protocol_recv_request_send_reply (struct connection *conn)
> /* Allocate the extents list for block status only. */
> if (cmd == NBD_CMD_BLOCK_STATUS) {
> extents = nbdkit_extents_new (offset, conn->exportsize);
> - if (extents == NULL)
> - goto out_of_memory;
> + if (extents...
2019 Apr 23
4
[PATCH nbdkit v2 0/2] Be careful not to leak server heap memory to the client.
Version 1 was here:
https://www.redhat.com/archives/libguestfs/2019-April/msg00144.html
Version 2 makes a couple of much larger changes:
The OCaml patch changes the API of the pread method so it matches what
other language bindings are already doing, ie. get the language plugin
to return a newly allocated buffer, check it is long enough, copy out
the data.
The server patch implements a
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
2020 Sep 07
0
NT_STATUS_NETWORK_SESSION_EXPIRED
...tilus gives error "invalid argument".
>
> GVFS debug log shows
>
> smbc_stat(smb://fileserver.domain.co.uk/share)
> SMBC_getatr: sending qpathinfo
> map_errno_from_nt_status: 32 bit codes: code=c000035c
> smbc errno NT_STATUS_NETWORK_SESSION_EXPIRED -> 22
> smb: send_reply(0x7fb930002840), failed=1 (Invalid argument)
> smb: backend_dbus_handler org.gtk.vfs.Mount:QueryInfo (pid=24714)
> smb: Queued new job 0x7fb924007700 (GVfsJobQueryInfo)
>
>
> These Linux desktops also mount shares from a Windows Server 2012
> server, using gio mount, and do not ex...
2020 Sep 07
0
NT_STATUS_NETWORK_SESSION_EXPIRED
...lus gives error "invalid argument".
>
> GVFS debug log shows
>
> smbc_stat(smb://fileserver.domain.co.uk/share)
> SMBC_getatr: sending qpathinfo
> map_errno_from_nt_status: 32 bit codes: code=c000035c
> smbc errno NT_STATUS_NETWORK_SESSION_EXPIRED -> 22
> smb: send_reply(0x7fb930002840), failed=1 (Invalid argument)
> smb: backend_dbus_handler org.gtk.vfs.Mount:QueryInfo (pid=24714)
> smb: Queued new job 0x7fb924007700 (GVfsJobQueryInfo)
>
>
> These Linux desktops also mount shares from a Windows Server 2012
> server, using gio mount, and do not...
2019 Mar 08
0
Re: [PATCH nbdkit] Minimal implementation of NBD Structured Replies.
...ffset_data + count);
This line is correct, but I had to remind myself of C precedence rules
on this one; writing 'count + sizeof offset_data' instead has the same
effect without worrying whether sizeof binds with higher or lower
precedence than +.
> @@ -1317,40 +1449,33 @@ recv_request_send_reply (struct connection *conn)
>
> /* Send the reply packet. */
> send_reply:
> - {
> - ACQUIRE_LOCK_FOR_CURRENT_SCOPE (&conn->write_lock);
> - if (get_status (conn) < 0)
> - return -1;
> - reply.magic = htobe32 (NBD_REPLY_MAGIC);
> - reply.h...
2011 Sep 20
17
Sched_op hypercall small questions
Greetings all.
Some small question regarding schedule poll operation hypercall.
1. struct sched_poll poll.timeout is measured in what unit of time?
Secs, ms? ns?
2. After issuing the hypercall_sched_op(SCHEDOP_poll, &poll); if no
timeout is used in poll struct how long will I yield the CPU?
3. If I issue the hypercall and the event never comes is it possible
to to yield the CPU for ever?
2019 Mar 08
2
[PATCH nbdkit] Minimal implementation of NBD Structured Replies.
...zeof error_data);
+ if (r == -1) {
+ nbdkit_error ("write data: %s: %m", name_of_nbd_cmd (cmd));
+ return set_status (conn, -1);
+ }
+ /* No human readable error message at the moment. */
+
+ return 1; /* command processed ok */
+}
+
static int
recv_request_send_reply (struct connection *conn)
{
int r;
struct request request;
- struct reply reply;
uint16_t cmd, flags;
uint32_t magic, count, error = 0;
uint64_t offset;
@@ -1317,40 +1449,33 @@ recv_request_send_reply (struct connection *conn)
/* Send the reply packet. */
send_reply:
- {
-...
2019 Mar 18
0
[PATCH nbdkit 2/2] server: Split out NBD protocol code from connections code.
...+extern int protocol_handshake_oldstyle (struct connection *conn)
+ __attribute__((__nonnull__ (1)));
+
+/* protocol-handshake-newstyle.c */
+extern int protocol_handshake_newstyle (struct connection *conn)
+ __attribute__((__nonnull__ (1)));
+
+/* protocol.c */
+extern int protocol_recv_request_send_reply (struct connection *conn)
+ __attribute__((__nonnull__ (1)));
/* crypto.c */
#define root_tls_certificates_dir sysconfdir "/pki/" PACKAGE_NAME
diff --git a/server/connections.c b/server/connections.c
index 7be282f..4ded28d 100644
--- a/server/connections.c
+++ b/server/connections.c...