Displaying 7 results from an estimated 7 matches for "libnbd_strict_command".
Did you mean:
libnbd_strict_commands
2020 Sep 04
0
[libnbd PATCH 1/2] api: Add nbd_set_strict_mode
...wever, for integration testing, it
+can be handy to coerce libnbd into sending such requests in
+order to test the robustness of the server in dealing with such
+traffic.
+
+The C<flags> argument is a bitmask, including zero or more of the
+following strictness flags:
+
+=over 4
+
+=item C<LIBNBD_STRICT_COMMANDS> = 1
+
+If set, this flag rejects client requests that do not comply with the
+set of advertised server flags (for example, attempting a write on
+a read-only server). If clear, this flag relies on the server to
+reject unexpected commands or unknown flags to supported commands.
+
+=back
+
+Fu...
2020 Sep 04
4
[RFC libnbd PATCH 0/2] Add knobs for client- vs. server-side validation
We have been inconsistent on how much we reject client-side without
even consulting the server, vs. how much we depend on the server to
detect failure (even if our request can be deemed undefined per NBD
protocol). I'd like to change it so that by default, we reject as
much as we can client-side for less traffic, but where the user can
also change things on the fly for server-side integration
2020 Sep 11
0
[libnbd PATCH v2 3/5] api: Add nbd_set_strict_mode
...handy to relax the strictness of libnbd, to coerce it into
+sending such requests over the network for testing the robustness
+of the server in dealing with such traffic.
+
+The C<flags> argument is a bitmask, including zero or more of the
+following strictness flags:
+
+=over 4
+
+=item C<LIBNBD_STRICT_COMMANDS> = 1
+
+If set, this flag rejects client requests that do not comply with the
+set of advertised server flags (for example, attempting a write on
+a read-only server, or attempting to use C<LIBNBD_CMD_FLAG_FUA> when
+L<nbd_can_fua(3)> returned false). If clear, this flag relies on...
2020 Sep 04
0
[libnbd PATCH 2/2] api: Add STRICT_BOUNDS to nbd_set_strict_mode
...f libnbd may add further flags.
diff --git a/lib/handle.c b/lib/handle.c
index a1fa142..817fcd3 100644
--- a/lib/handle.c
+++ b/lib/handle.c
@@ -75,7 +75,7 @@ nbd_create (void)
s = getenv ("LIBNBD_DEBUG");
h->debug = s && strcmp (s, "1") == 0;
- h->strict = LIBNBD_STRICT_COMMANDS;
+ h->strict = LIBNBD_STRICT_COMMANDS | LIBNBD_STRICT_BOUNDS;
h->public_state = STATE_START;
h->state = STATE_START;
diff --git a/lib/rw.c b/lib/rw.c
index b5c1698..adfb7ac 100644
--- a/lib/rw.c
+++ b/lib/rw.c
@@ -278,6 +278,18 @@ nbd_unlocked_aio_pread (struct nbd_handle *h, void...
2020 Sep 11
10
[libnbd PATCH v2 0/5] Add knobs for client- vs. server-side validation
In v2:
- now based on my proposal to add LIBNBD_SHUTDOWN_IMMEDIATE
- four flags instead of two: STRICT_FLAGS is new (patch 4),
and STRICT_BOUNDS is separate from STRICT_ZERO_SIZE (patch 5)
- various refactorings for more shared code and less duplication
Eric Blake (5):
api: Add xxx_MASK constant for each Flags type
generator: Refactor filtering of accepted OFlags
api: Add
2020 Sep 11
0
[libnbd PATCH v2 4/5] api: Add STRICT_FLAGS to set_strict_mode
...ntf (stderr, "%s: test failed: "
+ "nbd_pread did not fail with bogus flags\n",
+ argv[0]);
+ exit (EXIT_FAILURE);
+ }
+ check (EINVAL, "nbd_pread: ");
+ /* Use unknown command flags, server-side */
+ strict &= ~(LIBNBD_STRICT_FLAGS | LIBNBD_STRICT_COMMANDS);
+ if (nbd_set_strict_mode (nbd, strict) == -1) {
+ fprintf (stderr, "%s\n", nbd_get_error ());
+ exit (EXIT_FAILURE);
+ }
if (nbd_pread (nbd, buf, 1, 0, LIBNBD_CMD_FLAG_MASK + 1) != -1) {
fprintf (stderr, "%s: test failed: "
"nbd_pread did n...
2020 Sep 17
2
Re: [libnbd PATCH v2 4/5] api: Add STRICT_FLAGS to set_strict_mode
..."
> + "nbd_pread did not fail with bogus flags\n",
> + argv[0]);
> + exit (EXIT_FAILURE);
> + }
> + check (EINVAL, "nbd_pread: ");
> + /* Use unknown command flags, server-side */
> + strict &= ~(LIBNBD_STRICT_FLAGS | LIBNBD_STRICT_COMMANDS);
> + if (nbd_set_strict_mode (nbd, strict) == -1) {
> + fprintf (stderr, "%s\n", nbd_get_error ());
> + exit (EXIT_FAILURE);
> + }
> if (nbd_pread (nbd, buf, 1, 0, LIBNBD_CMD_FLAG_MASK + 1) != -1) {
> fprintf (stderr, "%s: test failed: "
>...