search for: nbd_eoverflow

Displaying 20 results from an estimated 21 matches for "nbd_eoverflow".

2019 Apr 23
0
[nbdkit PATCH 3/7] RFC: protocol: Only send EOVERFLOW when valid
...ffer (int sock, size_t count) /* Convert a system errno to an NBD_E* error code. */ static int -nbd_errno (int error) +nbd_errno (int error, bool flag_df) { switch (error) { case 0: @@ -349,7 +349,9 @@ nbd_errno (int error) return NBD_ESHUTDOWN; #endif case EOVERFLOW: - return NBD_EOVERFLOW; + if (flag_df) + return NBD_EOVERFLOW; + /* fallthrough */ case EINVAL: default: return NBD_EINVAL; @@ -368,7 +370,7 @@ send_simple_reply (struct connection *conn, reply.magic = htobe32 (NBD_SIMPLE_REPLY_MAGIC); reply.handle = handle; - reply.error = htobe32 (nbd_errn...
2019 Aug 30
0
Re: [Qemu-devel] [PATCH 2/5] nbd: Prepare for NBD_CMD_FLAG_FAST_ZERO
...ver to advertise support for it. >> >> Signed-off-by: Eric Blake <eblake@redhat.com> >> +++ b/nbd/server.c >> @@ -55,6 +55,8 @@ static int system_errno_to_nbd_errno(int err) >> return NBD_ENOSPC; >> case EOVERFLOW: >> return NBD_EOVERFLOW; >> + case ENOTSUP: >> + return NBD_ENOTSUP; > > This may provoke returning NBD_ENOTSUP in other cases, not only new one we are going to add. Correct. But the spec only said SHOULD avoid ENOTSUP in those other cases, not MUST avoid ENOTSUP; and in practice, either the...
2019 Jun 21
0
[libnbd PATCH v2 5/5] states: Add DF flag support for pread
When structured replies are negotiated, the server may advertise support for the DF flag (the server promises to return at most one data/hole chunk, or to fail with NBD_EOVERFLOW if the chunk would be too large). As both nbdkit and qemu-nbd support this flag (the former only trivially, but the latter by not compressing holes over the wire), it is worth exposing to clients, if only for testing purposes. I chose to specifically reject the flag for plain nbd_[aio_]pread (abou...
2019 Aug 23
1
[libnbd PATCH 1/1] api: Add support for FAST_ZERO flag
...NBD_FLAG_SEND_CACHE (1 << 10) +#define NBD_FLAG_SEND_FAST_ZERO (1 << 11) /* NBD options (new style handshake only). */ #define NBD_OPT_EXPORT_NAME 1 @@ -250,6 +251,7 @@ struct nbd_structured_reply_error { #define NBD_EINVAL 22 #define NBD_ENOSPC 28 #define NBD_EOVERFLOW 75 +#define NBD_ENOTSUP 95 #define NBD_ESHUTDOWN 108 #endif /* NBD_PROTOCOL_H */ diff --git a/generator/generator b/generator/generator index c509573..9b1f5d8 100755 --- a/generator/generator +++ b/generator/generator @@ -958,10 +958,11 @@ let all_enums = [ tls_enum ] let cmd_flags = { f...
2019 Apr 23
12
[nbdkit PATCH 0/7] Implement structured replies in nbd plugin
I'm hoping to implement .extents for the nbd plugin; this is a prerequisite. I'm not sure about patch 3 - if we like it, I'll squash it to 2, if we don't, I think we are okay just dropping it. I'm also wondering if we have to worry about malicious plugins that don't populate the entire .pread buffer in an effort to get nbdkit to expose portions of the heap; my patch 7 loses
2023 Feb 21
1
[PATCH v2 2/6] spec: Tweak description of maximum block size
...ays, busy times. Sorry about the insane delays here. On Mon, Nov 14, 2022 at 04:46:51PM -0600, Eric Blake wrote: > Commit 9f30fedb improved the spec to allow non-payload requests that > exceed any advertised maximum block size. Take this one step further > by permitting the server to use NBD_EOVERFLOW as a hint to the client > when a request is oversize (while permitting NBD_EINVAL for > back-compat), and by rewording the text to explicitly call out that > what is being advertised is the maximum payload length, not maximum > block size. This becomes more important when we add 64-bit...
2019 Apr 23
3
Re: [nbdkit PATCH 3/7] RFC: protocol: Only send EOVERFLOW when valid
...no to an NBD_E* error code. */ > static int > -nbd_errno (int error) > +nbd_errno (int error, bool flag_df) > { > switch (error) { > case 0: > @@ -349,7 +349,9 @@ nbd_errno (int error) > return NBD_ESHUTDOWN; > #endif > case EOVERFLOW: > - return NBD_EOVERFLOW; > + if (flag_df) > + return NBD_EOVERFLOW; > + /* fallthrough */ > case EINVAL: > default: > return NBD_EINVAL; > @@ -368,7 +370,7 @@ send_simple_reply (struct connection *conn, > > reply.magic = htobe32 (NBD_SIMPLE_REPLY_MAGIC); > reply.h...
2019 Aug 23
2
[PATCH 1/1] protocol: Add NBD_CMD_FLAG_FAST_ZERO
...uest without the flag would be fast after all. + If an error occurs, the server MUST set the appropriate error code in the error field. @@ -2125,6 +2168,7 @@ The following error values are defined: * `NBD_EINVAL` (22), Invalid argument. * `NBD_ENOSPC` (28), No space left on device. * `NBD_EOVERFLOW` (75), Value too large. +* `NBD_ENOTSUP` (95), Operation not supported. * `NBD_ESHUTDOWN` (108), Server is in the process of being shut down. The server SHOULD return `NBD_ENOSPC` if it receives a write request @@ -2139,6 +2183,10 @@ read-only export. The server SHOULD NOT return `NBD_EOVERFLOW...
2023 Mar 03
1
[PATCH v2 2/6] spec: Tweak description of maximum block size
...han just slow review time. > > On Mon, Nov 14, 2022 at 04:46:51PM -0600, Eric Blake wrote: > > Commit 9f30fedb improved the spec to allow non-payload requests that > > exceed any advertised maximum block size. Take this one step further > > by permitting the server to use NBD_EOVERFLOW as a hint to the client > > when a request is oversize (while permitting NBD_EINVAL for > > back-compat), and by rewording the text to explicitly call out that > > what is being advertised is the maximum payload length, not maximum > > block size. This becomes more importan...
2019 Aug 23
1
[nbdkit PATCH 1/3] server: Add internal support for NBDKIT_FLAG_FAST_ZERO
...ine NBD_CMD_FLAG_FAST_ZERO (1<<4) /* Error codes (previously errno). * See http://git.qemu.org/?p=qemu.git;a=commitdiff;h=ca4414804114fd0095b317785bc0b51862e62ebb @@ -239,6 +241,7 @@ extern const char *name_of_nbd_error (int); #define NBD_EINVAL 22 #define NBD_ENOSPC 28 #define NBD_EOVERFLOW 75 +#define NBD_ENOTSUP 95 #define NBD_ESHUTDOWN 108 #endif /* NBDKIT_PROTOCOL_H */ diff --git a/server/filters.c b/server/filters.c index 14ca0cc6..0dd2393e 100644 --- a/server/filters.c +++ b/server/filters.c @@ -403,8 +403,11 @@ next_zero (void *nxdata, uint32_t count, uint64_t offset, ui...
2019 Aug 23
22
cross-project patches: Add NBD Fast Zero support
This is a cover letter to a series of patches being proposed in tandem to four different projects: - nbd: Document a new NBD_CMD_FLAG_FAST_ZERO command flag - qemu: Implement the flag for both clients and server - libnbd: Implement the flag for clients - nbdkit: Implement the flag for servers, including the nbd passthrough client If you want to test the patches together, I've pushed a
2023 Apr 13
6
[PATCH v3 0/6] NBD 64-bit extensions (spec only)
v2 was here: https://lists.debian.org/nbd/2022/11/msg00030.html The bulk of the changes since then are: - forbid NBD_OPT_EXPORT_NAME once extended headers are negotiated (Wouter) - consistently use 'maximum payload', rather than a haphazard mix of 'maximum block payload' (Vladimir) At this point, I want to make sure we are happy with the spec before re-posting patches for
2019 Jun 21
9
[libnbd PATCH v2 0/5] nbd_pread_structured
Since v1: - rebase to applied patches - split out support for Int in callbacks - sort of test that callbacks work in OCaml (see comment in patch 5) - rename API to nbd_pread_structured - expose error as explicit parameter to callback Eric Blake (5): generator: Allow Int in callbacks states: Wire in a read callback states: Add nbd_pread_structured API states: Add tests for
2022 Nov 14
2
[PATCH v2 3/6] spec: Add NBD_OPT_EXTENDED_HEADERS
...imum payload size, although it may split the -overall reply among several chunks. For commands that do not require -a payload in either direction (such as `NBD_CMD_TRIM`), the client MAY -request a length larger than the maximum block size; the server SHOULD -NOT disconnect, but MAY reply with an `NBD_EOVERFLOW` or `NBD_EINVAL` -error if the oversize request would require more server resources than -the same command operating on only a maximum block size (such as some +without structured or extended replies), the client MUST NOT use a +length larger than the maximum block size. For replies where the +payl...
2019 Jun 18
17
[libnbd PATCH 0/8] Add nbd_pread_callback
I've mentioned this topic before (in fact, the idea of adding NBD_CMD_FLAG_DF was first mentioned at [1]), but finally finished enough of an implementation to feel confident in posting it. I'd still like to add something under examples/ that uses the new API to implement strict checking of a server's structured replies read implementation (ensure that a server never sends data after
2019 May 30
0
[nbdkit PATCH 3/4] nbd: Use libnbd 0.1
...M: - return EPERM; - case NBD_EIO: - return EIO; - case NBD_ENOMEM: - return ENOMEM; - default: - nbdkit_debug ("unexpected error %d, squashing to EINVAL", error); - /* fallthrough */ - case NBD_EINVAL: - return EINVAL; - case NBD_ENOSPC: - return ENOSPC; - case NBD_EOVERFLOW: - return EOVERFLOW; - case NBD_ESHUTDOWN: - return ESHUTDOWN; - } -} - /* Reader loop. */ void * nbdplug_reader (void *handle) { struct handle *h = handle; - bool done = false; int r; - while (!done) { - struct transaction *trans; - - r = nbdplug_reply_raw (h, &trans...
2019 Jun 12
0
[nbdkit PATCH v3 3/5] nbd: Use libnbd 0.1.3+
...M: - return EPERM; - case NBD_EIO: - return EIO; - case NBD_ENOMEM: - return ENOMEM; - default: - nbdkit_debug ("unexpected error %d, squashing to EINVAL", error); - /* fallthrough */ - case NBD_EINVAL: - return EINVAL; - case NBD_ENOSPC: - return ENOSPC; - case NBD_EOVERFLOW: - return EOVERFLOW; - case NBD_ESHUTDOWN: - return ESHUTDOWN; - } -} - /* Reader loop. */ void * nbdplug_reader (void *handle) { struct handle *h = handle; - bool done = false; int r; - while (!done) { - struct transaction *trans; - - r = nbdplug_reply_raw (h, &trans...
2020 Mar 19
1
[nbdkit PATCH] nbd: Drop nbd-standalone fallback
...M: - return EPERM; - case NBD_EIO: - return EIO; - case NBD_ENOMEM: - return ENOMEM; - default: - nbdkit_debug ("unexpected error %d, squashing to EINVAL", error); - /* fallthrough */ - case NBD_EINVAL: - return EINVAL; - case NBD_ENOSPC: - return ENOSPC; - case NBD_EOVERFLOW: - return EOVERFLOW; - case NBD_ESHUTDOWN: - return ESHUTDOWN; - } -} - -/* Reader loop. */ -void * -nbd_reader (void *handle) -{ - struct handle *h = handle; - bool done = false; - int r; - - while (!done) { - struct transaction *trans; - - r = nbd_reply_raw (h, &trans); -...
2019 May 30
5
[nbdkit PATCH 0/4] Play with libnbd for nbdkit-add
Patch 1 played with an early draft of Rich's Fedora 30 libnbd package: https://bugzilla.redhat.com/show_bug.cgi?id=1713767#c17 Note that comment 21 provides a newer package 0.1.1-1 with a different API; and that libnbd has more unreleased API changes in the pipeline (whether that will be called 0.2 or 0.1.2); so we'll have to tweak things based on what is actually available in distros.
2019 Jun 02
5
[nbdkit PATCH v2 0/5] Play with libnbd for nbdkit-nbd
libnbd-0.1.2-1 is now available in Fedora 29/30 updates-testing, although it was not compiled against libxml2 so it lacks uri support (I ended up testing patch 4 with a self-built libnbd). Diffs since v1 - rebase to master, bump from libnbd 0.1 to 0.1.2, add URI support, better timing results Still not done - patch 5 needs associated tests Eric Blake (5): nbd: Check for libnbd nbd: