search for: filter_finalize

Displaying 20 results from an estimated 39 matches for "filter_finalize".

2019 Mar 18
2
[PATCH nbdkit] wrapper: Set MALLOC_CHECK=1 and MALLOC_PERTURB_ (randomly).
.../lib64/libpthread.so.0 #1 0x0000000000408842 in lock_unload () at locks.c:97 #2 0x00000000004066ff in filter_free (b=0x203c330) at filters.c:77 #3 0x000000000040a6f4 in main (argc=11, argv=0x7ffc1f4486e8) at main.c:649 Thread 1 (Thread 0x7f1caaa5e700 (LWP 7226)): #0 0x000000000040732a in filter_finalize (b=0x203c330, conn=0x203d870) at filters.c:421 #1 0x0000000000404d07 in _handle_single_connection (sockin=6, sockout=6) at connections.c:239 #2 0x0000000000404d76 in handle_single_connection (sockin=6, sockout=6) at connections.c:258 #3 0x00000000004119f6 in start_thread (datav...
2019 Mar 18
0
Re: [PATCH nbdkit] wrapper: Set MALLOC_CHECK=1 and MALLOC_PERTURB_ (randomly).
...00000004066ff in filter_free (b=0x203c330) at filters.c:77 Do we need some sort of pthread_join() in filter_free() to allow... > #3 0x000000000040a6f4 in main (argc=11, argv=0x7ffc1f4486e8) at main.c:649 > > Thread 1 (Thread 0x7f1caaa5e700 (LWP 7226)): > #0 0x000000000040732a in filter_finalize (b=0x203c330, conn=0x203d870) > at filters.c:421 ...filter_finalize() time to finish its job? But I agree that solving the race is an independent patch. > #1 0x0000000000404d07 in _handle_single_connection (sockin=6, sockout=6) > at connections.c:239 > #2 0x000000000040...
2018 Aug 01
0
[PATCH v2 nbdkit 1/6] filters: Call all .prepare and .finalize methods, not just the first one.
...to the + * plugin. + */ + if (f->backend.next->prepare (f->backend.next, conn) == -1) + return -1; + + if (f->filter.prepare && + f->filter.prepare (&next_ops, &nxdata, handle) == -1) + return -1; + + return 0; } static int @@ -382,10 +389,14 @@ filter_finalize (struct backend *b, struct connection *conn) debug ("finalize"); - if (f->filter.finalize) - return f->filter.finalize (&next_ops, &nxdata, handle); - else - return f->backend.next->finalize (f->backend.next, conn); + /* Call these in reverse order t...
2019 Sep 30
5
[nbdkit PATCH 0/2] Fix nbdkit --run when nbdkit hits assertion
Found while working on the retry filter. Swap the order of the two patches to see nbdkit ignore assertion failures with status 0. Eric Blake (2): server: Propagate unexpected nbdkit failure with --run tests: Enhance captive test server/captive.c | 43 ++++++++++++++++++++++++++++++---------- tests/test-captive.sh | 46 +++++++++++++++++++++++++++++++++++++++---- 2 files changed, 75
2019 Oct 03
0
[nbdkit PATCH 4/4] server: Better documentation of .open ordering
...conn, int readonly) struct b_conn nxdata = { .b = b->next, .conn = conn }; /* Call these in order starting from the filter closest to the - * plugin. + * plugin, similar to typical .open order. */ if (backend_prepare (b->next, conn) == -1) return -1; @@ -431,7 +435,7 @@ filter_finalize (struct backend *b, struct connection *conn) debug ("%s: finalize", b->name); /* Call these in reverse order to .prepare above, starting from the - * filter furthest away from the plugin. + * filter furthest away from the plugin, and matching .close order. */ if (f-&g...
2019 Aug 30
0
[nbdkit PATCH 1/9] server: Fewer dereferences in filter
.../* Call these in order starting from the filter closest to the * plugin. */ - if (f->backend.next->prepare (f->backend.next, conn) == -1) + if (b->next->prepare (b->next, conn) == -1) return -1; if (f->filter.prepare && @@ -481,8 +475,8 @@ static int filter_finalize (struct backend *b, struct connection *conn) { struct backend_filter *f = container_of (b, struct backend_filter, backend); - void *handle = connection_get_handle (conn, f->backend.i); - struct b_conn nxdata = { .b = f->backend.next, .conn = conn }; + void *handle = connection_get_hand...
2018 Aug 01
0
[PATCH v2 nbdkit 3/6] filters: Print filter name in debugging messages.
...connection_get_handle (conn, f->backend.i); struct b_conn nxdata = { .b = f->backend.next, .conn = conn }; - debug ("prepare"); + debug ("%s: prepare", f->name); /* Call these in order starting from the filter closest to the * plugin. @@ -387,7 +387,7 @@ filter_finalize (struct backend *b, struct connection *conn) void *handle = connection_get_handle (conn, f->backend.i); struct b_conn nxdata = { .b = f->backend.next, .conn = conn }; - debug ("finalize"); + debug ("%s: finalize", f->name); /* Call these in reverse order...
2020 Sep 21
0
[nbdkit PATCH v3 06/14] api: Add .export_description
...@ filter_close (struct backend *b, void *handle) static struct nbdkit_next_ops next_ops = { .reopen = backend_reopen, + .export_description = backend_export_description, .get_size = backend_get_size, .can_write = backend_can_write, .can_flush = backend_can_flush, @@ -334,6 +335,17 @@ filter_finalize (struct backend *b, void *handle) return 0; } +static const char * +filter_export_description (struct backend *b, void *handle) +{ + struct backend_filter *f = container_of (b, struct backend_filter, backend); + + if (f->filter.export_description) + return f->filter.export_descripti...
2019 Oct 11
0
[PATCH NOT WORKING nbdkit v2 1/2] server: Add .ready_to_serve plugin method.
...{ @@ -668,6 +691,7 @@ static struct backend filter_functions = { .config = filter_config, .config_complete = filter_config_complete, .magic_config_key = plugin_magic_config_key, + .ready_to_serve = filter_ready_to_serve, .open = filter_open, .prepare = filter_prepare, .finalize = filter_finalize, diff --git a/server/internal.h b/server/internal.h index 167da59..4c9419d 100644 --- a/server/internal.h +++ b/server/internal.h @@ -312,6 +312,7 @@ struct backend { void (*config) (struct backend *, const char *key, const char *value); void (*config_complete) (struct backend *); const ch...
2019 Oct 04
6
[nbdkit PATCH 0/5] Another round of retry fixes
I still don't have .prepare/.finalize working cleanly across reopen, but did find a nasty bug where a botched assertion means we failed to notice reads beyond EOF in both the xz and retry filter. Refactoring backend.c will make .finalize work easier. Eric Blake (5): xz: Avoid reading beyond EOF retry: Check size before transactions tests: Test retry when get_size values change
2020 Feb 11
1
[nbdkit PATCH] filters: Make nxdata persistent
...nxdata->conn == conn); if (f->filter.prepare && - f->filter.prepare (&next_ops, &nxdata, handle, readonly) == -1) + f->filter.prepare (&next_ops, nxdata, nxdata->handle, readonly) == -1) return -1; return 0; @@ -434,10 +455,11 @@ static int filter_finalize (struct backend *b, struct connection *conn, void *handle) { struct backend_filter *f = container_of (b, struct backend_filter, backend); - struct b_conn nxdata = { .b = b->next, .conn = conn }; + struct b_conn *nxdata = handle; + assert (nxdata->b == b->next && nxdata->...
2020 Feb 12
0
[PATCH nbdkit 3/3] server: filters: Remove struct b_h.
...xdata->b == b->next); if (f->filter.prepare && - f->filter.prepare (&next_ops, nxdata, nxdata->handle, readonly) == -1) + f->filter.prepare (&next_ops, b->next, handle, readonly) == -1) return -1; return 0; @@ -453,11 +420,9 @@ static int filter_finalize (struct backend *b, void *handle) { struct backend_filter *f = container_of (b, struct backend_filter, backend); - struct b_h *nxdata = handle; - assert (nxdata->b == b->next); if (f->filter.finalize && - f->filter.finalize (&next_ops, nxdata, nxdata->hand...
2019 Oct 03
7
[nbdkit PATCH 0/4] More work with retry safety
I'm still working on another set of patches to have reopen call .finalize/.prepare (so that another filter can safely appear between retry and the plugin), but for tonight, these are the patches I think are ready to go. Eric Blake (4): retry: Handle can_fua and can_fast_zero changes tests: Test retry with different fua/fast-zero flags server: Close backends if a filter's .open fails
2020 Aug 25
0
[nbdkit PATCH 1/5] api: Add .default_export
...int is_tls) @@ -555,6 +566,7 @@ static struct backend filter_functions = { .after_fork = filter_after_fork, .preconnect = filter_preconnect, .list_exports = filter_list_exports, + .default_export = filter_default_export, .open = filter_open, .prepare = filter_prepare, .finalize = filter_finalize, diff --git a/server/plugins.c b/server/plugins.c index 218764da..924533cb 100644 --- a/server/plugins.c +++ b/server/plugins.c @@ -162,6 +162,7 @@ plugin_dump_fields (struct backend *b) HAS (after_fork); HAS (preconnect); HAS (list_exports); + HAS (default_export); HAS (open); HAS...
2019 Aug 30
0
[nbdkit PATCH 2/9] server: Consolidate common backend tasks into new backend.c
...= connection_get_handle (conn, b->i); struct b_conn nxdata = { .b = b->next, .conn = conn }; - debug ("%s: prepare", f->name); + debug ("%s: prepare", b->name); /* Call these in order starting from the filter closest to the * plugin. @@ -478,7 +452,7 @@ filter_finalize (struct backend *b, struct connection *conn) void *handle = connection_get_handle (conn, b->i); struct b_conn nxdata = { .b = b->next, .conn = conn }; - debug ("%s: finalize", f->name); + debug ("%s: finalize", b->name); /* Call these in reverse order to...
2018 Aug 01
12
[PATCH v2 nbdkit 0/6] Add truncate filter and other fixes.
I have dropped the map filter from this series for now while I try to get it working. However I think the truncate filter is in a good shape. This incorporates all feedback from Eric's review. Also there are three small fixes to the filter code, all revealed when I was testing using multiple filters which we'd not done much of before. Rich.
2018 Jan 19
0
[PATCH nbdkit filters-v2 2/5] Introduce filters.
...struct b_conn nxdata = { .b = f->backend.next, .conn = conn }; + + debug ("prepare"); + + if (f->filter.prepare) + return f->filter.prepare (&next_ops, &nxdata, handle); + else + return f->backend.next->prepare (f->backend.next, conn); +} + +static int +filter_finalize (struct backend *b, struct connection *conn) +{ + struct backend_filter *f = container_of (b, struct backend_filter, backend); + void *handle = connection_get_handle (conn, f->backend.i); + struct b_conn nxdata = { .b = f->backend.next, .conn = conn }; + + debug ("finalize"); +...
2018 Jan 19
0
[PATCH nbdkit filters-v3 3/7] Introduce filters.
...struct b_conn nxdata = { .b = f->backend.next, .conn = conn }; + + debug ("prepare"); + + if (f->filter.prepare) + return f->filter.prepare (&next_ops, &nxdata, handle); + else + return f->backend.next->prepare (f->backend.next, conn); +} + +static int +filter_finalize (struct backend *b, struct connection *conn) +{ + struct backend_filter *f = container_of (b, struct backend_filter, backend); + void *handle = connection_get_handle (conn, f->backend.i); + struct b_conn nxdata = { .b = f->backend.next, .conn = conn }; + + debug ("finalize"); +...
2020 Feb 11
0
[PATCH nbdkit 3/3] server: Remove explicit connection parameter, use TLS instead.
...); + assert (nxdata->b == b->next); if (f->filter.prepare && f->filter.prepare (&next_ops, nxdata, nxdata->handle, readonly) == -1) return -1; @@ -452,12 +450,12 @@ filter_prepare (struct backend *b, struct connection *conn, void *handle, } static int -filter_finalize (struct backend *b, struct connection *conn, void *handle) +filter_finalize (struct backend *b, void *handle) { struct backend_filter *f = container_of (b, struct backend_filter, backend); - struct b_conn *nxdata = handle; + struct b_h *nxdata = handle; - assert (nxdata->b == b->next...
2018 Feb 01
0
[nbdkit PATCH v2 1/3] backend: Rework internal/filter error return semantics
...= { @@ -567,7 +589,6 @@ static struct backend filter_functions = { .dump_fields = filter_dump_fields, .config = filter_config, .config_complete = filter_config_complete, - .errno_is_preserved = plugin_errno_is_preserved, .open = filter_open, .prepare = filter_prepare, .finalize = filter_finalize, diff --git a/src/plugins.c b/src/plugins.c index dba3e24..c49c0f0 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -227,14 +227,6 @@ plugin_config_complete (struct backend *b) exit (EXIT_FAILURE); } -static int -plugin_errno_is_preserved (struct backend *b) -{ - struct backend_plugin *p =...